{"action":"created","comment":{"url":"https://api.github.com/repos/docker/swarm/pulls/comments/56065485","id":56065485,"diff_hunk":"@@ -0,0 +1,56 @@\n+#!/usr/bin/env bats\n+\n+load helpers\n+\n+function teardown() {\n+\tswarm_manage_cleanup\n+\tstop_docker\n+}\n+\n+@test \"containerslots filter\" {\n+    export DOCKER_DAEMON_ADDITIONAL_PARAMETERS=\"--label containerslots=2\"\n+\tstart_docker_with_busybox 2\n+\tswarm_manage\n+\n+\t# Use busybox to save image pulling time for integration test.\n+\t# Running the first 4 containers, it should be fine.\n+\trun docker_swarm run -d -t busybox sh\n+\t[ \"$status\" -eq 0 ]\n+\trun docker_swarm run -d -t busybox sh\n+\t[ \"$status\" -eq 0 ]\n+\trun docker_swarm run -d -t busybox sh\n+    [ \"$status\" -eq 0 ]\n+    run docker_swarm run -d -t busybox sh\n+    [ \"$status\" -eq 0 ]\n+\n+\t# When trying to start the 5th one, it should be error finding a node with free slots.\n+\trun docker_swarm run -d -t busybox sh\n+\t[ \"$status\" -ne 0 ]\n+\t[[ \"${lines[0]}\" == *\"node with enough open slots available\"* ]]\n+\n+\t# And the number of running containers should be still 4.\n+\trun docker_swarm ps\n+\t[ \"${#lines[@]}\" -eq 5 ]\n+}\n+\n+@test \"containerslots without existing label\" {\n+    start_docker_with_busybox 2\n+    swarm_manage\n+\n+    # Use busybox to save image pulling time for integration test.\n+    # Running more than 5 containers, it should be fine.\n+    run docker_swarm run -d -t busybox sh\n+    [ \"$status\" -eq 0 ]\n+    run docker_swarm run -d -t busybox sh\n+    [ \"$status\" -eq 0 ]\n+    run docker_swarm run -d -t busybox sh\n+    [ \"$status\" -eq 0 ]\n+    run docker_swarm run -d -t busybox sh\n+    [ \"$status\" -eq 0 ]\n+    run docker_swarm run -d -t busybox sh\n+    [ \"$status\" -eq 0 ]\n+\n+    # And the number of running containers should be 5.\n+\trun docker_swarm ps\n+\t[ \"${#lines[@]}\" -eq 6 ]","path":"test/integration/containerslots-filter.bats","position":55,"original_position":55,"commit_id":"d3c425b79c93963b43b7029e30129830f28fadf4","original_commit_id":"d3c425b79c93963b43b7029e30129830f28fadf4","user":{"login":"vieux","id":1032519,"avatar_url":"https://avatars.githubusercontent.com/u/1032519?v=3","gravatar_id":"","url":"https://api.github.com/users/vieux","html_url":"https://github.com/vieux","followers_url":"https://api.github.com/users/vieux/followers","following_url":"https://api.github.com/users/vieux/following{/other_user}","gists_url":"https://api.github.com/users/vieux/gists{/gist_id}","starred_url":"https://api.github.com/users/vieux/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vieux/subscriptions","organizations_url":"https://api.github.com/users/vieux/orgs","repos_url":"https://api.github.com/users/vieux/repos","events_url":"https://api.github.com/users/vieux/events{/privacy}","received_events_url":"https://api.github.com/users/vieux/received_events","type":"User","site_admin":false},"body":"indentation seems wrong\r\n","created_at":"2016-03-14T19:58:51Z","updated_at":"2016-03-14T19:58:51Z","html_url":"https://github.com/docker/swarm/pull/1809#discussion_r56065485","pull_request_url":"https://api.github.com/repos/docker/swarm/pulls/1809","_links":{"self":{"href":"https://api.github.com/repos/docker/swarm/pulls/comments/56065485"},"html":{"href":"https://github.com/docker/swarm/pull/1809#discussion_r56065485"},"pull_request":{"href":"https://api.github.com/repos/docker/swarm/pulls/1809"}}},"pull_request":{"url":"https://api.github.com/repos/docker/swarm/pulls/1809","id":59149644,"html_url":"https://github.com/docker/swarm/pull/1809","diff_url":"https://github.com/docker/swarm/pull/1809.diff","patch_url":"https://github.com/docker/swarm/pull/1809.patch","issue_url":"https://api.github.com/repos/docker/swarm/issues/1809","number":1809,"state":"open","locked":false,"title":"Filter for containerslots-label","user":{"login":"xFragger","id":808138,"avatar_url":"https://avatars.githubusercontent.com/u/808138?v=3","gravatar_id":"","url":"https://api.github.com/users/xFragger","html_url":"https://github.com/xFragger","followers_url":"https://api.github.com/users/xFragger/followers","following_url":"https://api.github.com/users/xFragger/following{/other_user}","gists_url":"https://api.github.com/users/xFragger/gists{/gist_id}","starred_url":"https://api.github.com/users/xFragger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xFragger/subscriptions","organizations_url":"https://api.github.com/users/xFragger/orgs","repos_url":"https://api.github.com/users/xFragger/repos","events_url":"https://api.github.com/users/xFragger/events{/privacy}","received_events_url":"https://api.github.com/users/xFragger/received_events","type":"User","site_admin":false},"body":"As proposed in #1734 ","created_at":"2016-02-12T09:28:11Z","updated_at":"2016-03-14T19:58:51Z","closed_at":null,"merged_at":null,"merge_commit_sha":"12125ddccfb5b70c11b4fca815c3eff2a4c30a2e","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/docker/swarm/pulls/1809/commits","review_comments_url":"https://api.github.com/repos/docker/swarm/pulls/1809/comments","review_comment_url":"https://api.github.com/repos/docker/swarm/pulls/comments{/number}","comments_url":"https://api.github.com/repos/docker/swarm/issues/1809/comments","statuses_url":"https://api.github.com/repos/docker/swarm/statuses/d3c425b79c93963b43b7029e30129830f28fadf4","head":{"label":"xFragger:master","ref":"master","sha":"d3c425b79c93963b43b7029e30129830f28fadf4","user":{"login":"xFragger","id":808138,"avatar_url":"https://avatars.githubusercontent.com/u/808138?v=3","gravatar_id":"","url":"https://api.github.com/users/xFragger","html_url":"https://github.com/xFragger","followers_url":"https://api.github.com/users/xFragger/followers","following_url":"https://api.github.com/users/xFragger/following{/other_user}","gists_url":"https://api.github.com/users/xFragger/gists{/gist_id}","starred_url":"https://api.github.com/users/xFragger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xFragger/subscriptions","organizations_url":"https://api.github.com/users/xFragger/orgs","repos_url":"https://api.github.com/users/xFragger/repos","events_url":"https://api.github.com/users/xFragger/events{/privacy}","received_events_url":"https://api.github.com/users/xFragger/received_events","type":"User","site_admin":false},"repo":{"id":51577697,"name":"swarm","full_name":"xFragger/swarm","owner":{"login":"xFragger","id":808138,"avatar_url":"https://avatars.githubusercontent.com/u/808138?v=3","gravatar_id":"","url":"https://api.github.com/users/xFragger","html_url":"https://github.com/xFragger","followers_url":"https://api.github.com/users/xFragger/followers","following_url":"https://api.github.com/users/xFragger/following{/other_user}","gists_url":"https://api.github.com/users/xFragger/gists{/gist_id}","starred_url":"https://api.github.com/users/xFragger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xFragger/subscriptions","organizations_url":"https://api.github.com/users/xFragger/orgs","repos_url":"https://api.github.com/users/xFragger/repos","events_url":"https://api.github.com/users/xFragger/events{/privacy}","received_events_url":"https://api.github.com/users/xFragger/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/xFragger/swarm","description":"Swarm: a Docker-native clustering system","fork":true,"url":"https://api.github.com/repos/xFragger/swarm","forks_url":"https://api.github.com/repos/xFragger/swarm/forks","keys_url":"https://api.github.com/repos/xFragger/swarm/keys{/key_id}","collaborators_url":"https://api.github.com/repos/xFragger/swarm/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/xFragger/swarm/teams","hooks_url":"https://api.github.com/repos/xFragger/swarm/hooks","issue_events_url":"https://api.github.com/repos/xFragger/swarm/issues/events{/number}","events_url":"https://api.github.com/repos/xFragger/swarm/events","assignees_url":"https://api.github.com/repos/xFragger/swarm/assignees{/user}","branches_url":"https://api.github.com/repos/xFragger/swarm/branches{/branch}","tags_url":"https://api.github.com/repos/xFragger/swarm/tags","blobs_url":"https://api.github.com/repos/xFragger/swarm/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/xFragger/swarm/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/xFragger/swarm/git/refs{/sha}","trees_url":"https://api.github.com/repos/xFragger/swarm/git/trees{/sha}","statuses_url":"https://api.github.com/repos/xFragger/swarm/statuses/{sha}","languages_url":"https://api.github.com/repos/xFragger/swarm/languages","stargazers_url":"https://api.github.com/repos/xFragger/swarm/stargazers","contributors_url":"https://api.github.com/repos/xFragger/swarm/contributors","subscribers_url":"https://api.github.com/repos/xFragger/swarm/subscribers","subscription_url":"https://api.github.com/repos/xFragger/swarm/subscription","commits_url":"https://api.github.com/repos/xFragger/swarm/commits{/sha}","git_commits_url":"https://api.github.com/repos/xFragger/swarm/git/commits{/sha}","comments_url":"https://api.github.com/repos/xFragger/swarm/comments{/number}","issue_comment_url":"https://api.github.com/repos/xFragger/swarm/issues/comments{/number}","contents_url":"https://api.github.com/repos/xFragger/swarm/contents/{+path}","compare_url":"https://api.github.com/repos/xFragger/swarm/compare/{base}...{head}","merges_url":"https://api.github.com/repos/xFragger/swarm/merges","archive_url":"https://api.github.com/repos/xFragger/swarm/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/xFragger/swarm/downloads","issues_url":"https://api.github.com/repos/xFragger/swarm/issues{/number}","pulls_url":"https://api.github.com/repos/xFragger/swarm/pulls{/number}","milestones_url":"https://api.github.com/repos/xFragger/swarm/milestones{/number}","notifications_url":"https://api.github.com/repos/xFragger/swarm/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/xFragger/swarm/labels{/name}","releases_url":"https://api.github.com/repos/xFragger/swarm/releases{/id}","deployments_url":"https://api.github.com/repos/xFragger/swarm/deployments","created_at":"2016-02-12T09:23:06Z","updated_at":"2016-02-12T09:23:07Z","pushed_at":"2016-03-14T09:00:54Z","git_url":"git://github.com/xFragger/swarm.git","ssh_url":"git@github.com:xFragger/swarm.git","clone_url":"https://github.com/xFragger/swarm.git","svn_url":"https://github.com/xFragger/swarm","homepage":"","size":11706,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"docker:master","ref":"master","sha":"42b1620f4d34a88f785991fcb082caff46e47fde","user":{"login":"docker","id":5429470,"avatar_url":"https://avatars.githubusercontent.com/u/5429470?v=3","gravatar_id":"","url":"https://api.github.com/users/docker","html_url":"https://github.com/docker","followers_url":"https://api.github.com/users/docker/followers","following_url":"https://api.github.com/users/docker/following{/other_user}","gists_url":"https://api.github.com/users/docker/gists{/gist_id}","starred_url":"https://api.github.com/users/docker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/docker/subscriptions","organizations_url":"https://api.github.com/users/docker/orgs","repos_url":"https://api.github.com/users/docker/repos","events_url":"https://api.github.com/users/docker/events{/privacy}","received_events_url":"https://api.github.com/users/docker/received_events","type":"Organization","site_admin":false},"repo":{"id":19360616,"name":"swarm","full_name":"docker/swarm","owner":{"login":"docker","id":5429470,"avatar_url":"https://avatars.githubusercontent.com/u/5429470?v=3","gravatar_id":"","url":"https://api.github.com/users/docker","html_url":"https://github.com/docker","followers_url":"https://api.github.com/users/docker/followers","following_url":"https://api.github.com/users/docker/following{/other_user}","gists_url":"https://api.github.com/users/docker/gists{/gist_id}","starred_url":"https://api.github.com/users/docker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/docker/subscriptions","organizations_url":"https://api.github.com/users/docker/orgs","repos_url":"https://api.github.com/users/docker/repos","events_url":"https://api.github.com/users/docker/events{/privacy}","received_events_url":"https://api.github.com/users/docker/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/docker/swarm","description":"Swarm: a Docker-native clustering system","fork":false,"url":"https://api.github.com/repos/docker/swarm","forks_url":"https://api.github.com/repos/docker/swarm/forks","keys_url":"https://api.github.com/repos/docker/swarm/keys{/key_id}","collaborators_url":"https://api.github.com/repos/docker/swarm/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/docker/swarm/teams","hooks_url":"https://api.github.com/repos/docker/swarm/hooks","issue_events_url":"https://api.github.com/repos/docker/swarm/issues/events{/number}","events_url":"https://api.github.com/repos/docker/swarm/events","assignees_url":"https://api.github.com/repos/docker/swarm/assignees{/user}","branches_url":"https://api.github.com/repos/docker/swarm/branches{/branch}","tags_url":"https://api.github.com/repos/docker/swarm/tags","blobs_url":"https://api.github.com/repos/docker/swarm/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/docker/swarm/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/docker/swarm/git/refs{/sha}","trees_url":"https://api.github.com/repos/docker/swarm/git/trees{/sha}","statuses_url":"https://api.github.com/repos/docker/swarm/statuses/{sha}","languages_url":"https://api.github.com/repos/docker/swarm/languages","stargazers_url":"https://api.github.com/repos/docker/swarm/stargazers","contributors_url":"https://api.github.com/repos/docker/swarm/contributors","subscribers_url":"https://api.github.com/repos/docker/swarm/subscribers","subscription_url":"https://api.github.com/repos/docker/swarm/subscription","commits_url":"https://api.github.com/repos/docker/swarm/commits{/sha}","git_commits_url":"https://api.github.com/repos/docker/swarm/git/commits{/sha}","comments_url":"https://api.github.com/repos/docker/swarm/comments{/number}","issue_comment_url":"https://api.github.com/repos/docker/swarm/issues/comments{/number}","contents_url":"https://api.github.com/repos/docker/swarm/contents/{+path}","compare_url":"https://api.github.com/repos/docker/swarm/compare/{base}...{head}","merges_url":"https://api.github.com/repos/docker/swarm/merges","archive_url":"https://api.github.com/repos/docker/swarm/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/docker/swarm/downloads","issues_url":"https://api.github.com/repos/docker/swarm/issues{/number}","pulls_url":"https://api.github.com/repos/docker/swarm/pulls{/number}","milestones_url":"https://api.github.com/repos/docker/swarm/milestones{/number}","notifications_url":"https://api.github.com/repos/docker/swarm/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/docker/swarm/labels{/name}","releases_url":"https://api.github.com/repos/docker/swarm/releases{/id}","deployments_url":"https://api.github.com/repos/docker/swarm/deployments","created_at":"2014-05-01T23:15:17Z","updated_at":"2016-03-14T09:48:10Z","pushed_at":"2016-03-14T16:29:19Z","git_url":"git://github.com/docker/swarm.git","ssh_url":"git@github.com:docker/swarm.git","clone_url":"https://github.com/docker/swarm.git","svn_url":"https://github.com/docker/swarm","homepage":"","size":52006,"stargazers_count":3514,"watchers_count":3514,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":620,"mirror_url":null,"open_issues_count":213,"forks":620,"open_issues":213,"watchers":3514,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/docker/swarm/pulls/1809"},"html":{"href":"https://github.com/docker/swarm/pull/1809"},"issue":{"href":"https://api.github.com/repos/docker/swarm/issues/1809"},"comments":{"href":"https://api.github.com/repos/docker/swarm/issues/1809/comments"},"review_comments":{"href":"https://api.github.com/repos/docker/swarm/pulls/1809/comments"},"review_comment":{"href":"https://api.github.com/repos/docker/swarm/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/docker/swarm/pulls/1809/commits"},"statuses":{"href":"https://api.github.com/repos/docker/swarm/statuses/d3c425b79c93963b43b7029e30129830f28fadf4"}}}}