{"action":"created","comment":{"url":"https://api.github.com/repos/moby/moby/pulls/comments/170730845","pull_request_review_id":99461496,"id":170730845,"diff_hunk":"@@ -172,6 +174,54 @@ func (s *DockerSuite) TestAPINetworkConnectDisconnect(c *check.C) {\n \t// delete the network\n \tdeleteNetwork(c, nr.ID, true)\n }\n+func delInterface(c *check.C, ifName string) {\n+\ticmd.RunCommand(\"ip\", \"link\", \"delete\", ifName).Assert(c, icmd.Success)\n+\ticmd.RunCommand(\"iptables\", \"-t\", \"nat\", \"--flush\").Assert(c, icmd.Success)\n+\ticmd.RunCommand(\"iptables\", \"--flush\").Assert(c, icmd.Success)\n+}\n+func (s *DockerDaemonSuite) TestAPIDaemonNetworkPools(c *check.C) {\n+\ttestRequires(c, DaemonIsLinux, SameHostDaemon)\n+\n+\t// Remove docker0 bridge and the start daemon defining the predefined address pools\n+\tdefaultNetworkBridge := \"docker0\"\n+\tdelInterface(c, defaultNetworkBridge)\n+\ts.d.Start(c,\n+\t\t\"--default-node-local-address-pools\", \"base=175.30.0.0/16,size=16\",\n+\t\t\"--default-node-local-address-pools\", \"base=175.33.0.0/16,size=24\")\n+\n+\t// Verify bridge network's subnet\n+\tcli, err := s.d.NewClient()\n+\tc.Assert(err, checker.IsNil)\n+\tdefer cli.Close()\n+\tout, err := cli.NetworkInspect(context.Background(), \"bridge\", types.NetworkInspectOptions{})\n+\tc.Assert(err, check.IsNil)\n+\t//c.Assert(out, checker.Contains, \"175.30.0.0/16\")\n+\tc.Assert(out.IPAM.Config[0].Subnet, checker.Equals, \"175.30.0.0/16\")\n+\n+\t// Create a bridge network and verify its subnet is the second default pool","path":"integration-cli/docker_api_network_test.go","position":37,"original_position":37,"commit_id":"b167eddfdd38bf28db3a342e9416af949e9d1daa","original_commit_id":"b167eddfdd38bf28db3a342e9416af949e9d1daa","user":{"login":"selansen","id":10554015,"avatar_url":"https://avatars3.githubusercontent.com/u/10554015?v=4","gravatar_id":"","url":"https://api.github.com/users/selansen","html_url":"https://github.com/selansen","followers_url":"https://api.github.com/users/selansen/followers","following_url":"https://api.github.com/users/selansen/following{/other_user}","gists_url":"https://api.github.com/users/selansen/gists{/gist_id}","starred_url":"https://api.github.com/users/selansen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/selansen/subscriptions","organizations_url":"https://api.github.com/users/selansen/orgs","repos_url":"https://api.github.com/users/selansen/repos","events_url":"https://api.github.com/users/selansen/events{/privacy}","received_events_url":"https://api.github.com/users/selansen/received_events","type":"User","site_admin":false},"body":"It is same test case. We are testing it by creating 2 different network and make sure they fall into same user defined subnet. thats all.","created_at":"2018-02-26T20:49:41Z","updated_at":"2018-02-26T20:49:41Z","html_url":"https://github.com/moby/moby/pull/36396#discussion_r170730845","pull_request_url":"https://api.github.com/repos/moby/moby/pulls/36396","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/moby/moby/pulls/comments/170730845"},"html":{"href":"https://github.com/moby/moby/pull/36396#discussion_r170730845"},"pull_request":{"href":"https://api.github.com/repos/moby/moby/pulls/36396"}},"in_reply_to_id":170709550},"pull_request":{"url":"https://api.github.com/repos/moby/moby/pulls/36396","id":171138310,"html_url":"https://github.com/moby/moby/pull/36396","diff_url":"https://github.com/moby/moby/pull/36396.diff","patch_url":"https://github.com/moby/moby/pull/36396.patch","issue_url":"https://api.github.com/repos/moby/moby/issues/36396","number":36396,"state":"open","locked":false,"title":"Allow user to specify default address pools for docker networks","user":{"login":"selansen","id":10554015,"avatar_url":"https://avatars3.githubusercontent.com/u/10554015?v=4","gravatar_id":"","url":"https://api.github.com/users/selansen","html_url":"https://github.com/selansen","followers_url":"https://api.github.com/users/selansen/followers","following_url":"https://api.github.com/users/selansen/following{/other_user}","gists_url":"https://api.github.com/users/selansen/gists{/gist_id}","starred_url":"https://api.github.com/users/selansen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/selansen/subscriptions","organizations_url":"https://api.github.com/users/selansen/orgs","repos_url":"https://api.github.com/users/selansen/repos","events_url":"https://api.github.com/users/selansen/events{/privacy}","received_events_url":"https://api.github.com/users/selansen/received_events","type":"User","site_admin":false},"body":"This is continuation of PR https://github.com/moby/moby/pull/36054\r\n. I updated all review comments and  re-vendor libnetwork. While doing so , I accidentally  deleted my commits. Hence I was not able to update into PR 36054.\r\n\r\nDescription\r\nWhen user creates a network without specifying a --subnet, docker will pick a subnet for the network from the static set 172.[17-31].0.0/16 and 192.168.[0-240].0/20 for the local scope networks and from the static set 10.[0-255].[0-255].0/24 for the global scope networks.\r\nFor different reasons, several users have asked to be able to control these defaults.\r\nThis PR brings in a change to allow users to control the default address pools at daemon boot.\r\n\r\nAs an example,\r\ndockerd --default-address-pools base=10.10.0.0/16,size=24\r\nwould allow user to set the 256 pools 10.10.[0-255].0/24 as default for the local scope networks.\r\n\r\nMultiple --default-address-pools can be specified.\r\nTo specify the option in the config json file:\r\n\r\n{\"default-address-pools\":[{\"base\":\"172.80.0.0/16\",\"size\":24},{\"base\":\"172.90.0.0/16\",\"size\":24}]}","created_at":"2018-02-23T23:11:07Z","updated_at":"2018-02-26T20:49:41Z","closed_at":null,"merged_at":null,"merge_commit_sha":"799402862ac4f44d3b3889c2916c4325bdf7ab06","assignee":null,"assignees":[],"requested_reviewers":[{"login":"vdemeester","id":6508,"avatar_url":"https://avatars0.githubusercontent.com/u/6508?v=4","gravatar_id":"","url":"https://api.github.com/users/vdemeester","html_url":"https://github.com/vdemeester","followers_url":"https://api.github.com/users/vdemeester/followers","following_url":"https://api.github.com/users/vdemeester/following{/other_user}","gists_url":"https://api.github.com/users/vdemeester/gists{/gist_id}","starred_url":"https://api.github.com/users/vdemeester/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vdemeester/subscriptions","organizations_url":"https://api.github.com/users/vdemeester/orgs","repos_url":"https://api.github.com/users/vdemeester/repos","events_url":"https://api.github.com/users/vdemeester/events{/privacy}","received_events_url":"https://api.github.com/users/vdemeester/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[{"id":175375318,"url":"https://api.github.com/repos/moby/moby/labels/status/1-design-review","name":"status/1-design-review","color":"fef2c0","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/moby/moby/pulls/36396/commits","review_comments_url":"https://api.github.com/repos/moby/moby/pulls/36396/comments","review_comment_url":"https://api.github.com/repos/moby/moby/pulls/comments{/number}","comments_url":"https://api.github.com/repos/moby/moby/issues/36396/comments","statuses_url":"https://api.github.com/repos/moby/moby/statuses/b167eddfdd38bf28db3a342e9416af949e9d1daa","head":{"label":"selansen:master","ref":"master","sha":"b167eddfdd38bf28db3a342e9416af949e9d1daa","user":{"login":"selansen","id":10554015,"avatar_url":"https://avatars3.githubusercontent.com/u/10554015?v=4","gravatar_id":"","url":"https://api.github.com/users/selansen","html_url":"https://github.com/selansen","followers_url":"https://api.github.com/users/selansen/followers","following_url":"https://api.github.com/users/selansen/following{/other_user}","gists_url":"https://api.github.com/users/selansen/gists{/gist_id}","starred_url":"https://api.github.com/users/selansen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/selansen/subscriptions","organizations_url":"https://api.github.com/users/selansen/orgs","repos_url":"https://api.github.com/users/selansen/repos","events_url":"https://api.github.com/users/selansen/events{/privacy}","received_events_url":"https://api.github.com/users/selansen/received_events","type":"User","site_admin":false},"repo":{"id":112528409,"name":"moby","full_name":"selansen/moby","owner":{"login":"selansen","id":10554015,"avatar_url":"https://avatars3.githubusercontent.com/u/10554015?v=4","gravatar_id":"","url":"https://api.github.com/users/selansen","html_url":"https://github.com/selansen","followers_url":"https://api.github.com/users/selansen/followers","following_url":"https://api.github.com/users/selansen/following{/other_user}","gists_url":"https://api.github.com/users/selansen/gists{/gist_id}","starred_url":"https://api.github.com/users/selansen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/selansen/subscriptions","organizations_url":"https://api.github.com/users/selansen/orgs","repos_url":"https://api.github.com/users/selansen/repos","events_url":"https://api.github.com/users/selansen/events{/privacy}","received_events_url":"https://api.github.com/users/selansen/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/selansen/moby","description":"Moby Project - a collaborative project for the container ecosystem to assemble container-based systems","fork":true,"url":"https://api.github.com/repos/selansen/moby","forks_url":"https://api.github.com/repos/selansen/moby/forks","keys_url":"https://api.github.com/repos/selansen/moby/keys{/key_id}","collaborators_url":"https://api.github.com/repos/selansen/moby/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/selansen/moby/teams","hooks_url":"https://api.github.com/repos/selansen/moby/hooks","issue_events_url":"https://api.github.com/repos/selansen/moby/issues/events{/number}","events_url":"https://api.github.com/repos/selansen/moby/events","assignees_url":"https://api.github.com/repos/selansen/moby/assignees{/user}","branches_url":"https://api.github.com/repos/selansen/moby/branches{/branch}","tags_url":"https://api.github.com/repos/selansen/moby/tags","blobs_url":"https://api.github.com/repos/selansen/moby/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/selansen/moby/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/selansen/moby/git/refs{/sha}","trees_url":"https://api.github.com/repos/selansen/moby/git/trees{/sha}","statuses_url":"https://api.github.com/repos/selansen/moby/statuses/{sha}","languages_url":"https://api.github.com/repos/selansen/moby/languages","stargazers_url":"https://api.github.com/repos/selansen/moby/stargazers","contributors_url":"https://api.github.com/repos/selansen/moby/contributors","subscribers_url":"https://api.github.com/repos/selansen/moby/subscribers","subscription_url":"https://api.github.com/repos/selansen/moby/subscription","commits_url":"https://api.github.com/repos/selansen/moby/commits{/sha}","git_commits_url":"https://api.github.com/repos/selansen/moby/git/commits{/sha}","comments_url":"https://api.github.com/repos/selansen/moby/comments{/number}","issue_comment_url":"https://api.github.com/repos/selansen/moby/issues/comments{/number}","contents_url":"https://api.github.com/repos/selansen/moby/contents/{+path}","compare_url":"https://api.github.com/repos/selansen/moby/compare/{base}...{head}","merges_url":"https://api.github.com/repos/selansen/moby/merges","archive_url":"https://api.github.com/repos/selansen/moby/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/selansen/moby/downloads","issues_url":"https://api.github.com/repos/selansen/moby/issues{/number}","pulls_url":"https://api.github.com/repos/selansen/moby/pulls{/number}","milestones_url":"https://api.github.com/repos/selansen/moby/milestones{/number}","notifications_url":"https://api.github.com/repos/selansen/moby/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/selansen/moby/labels{/name}","releases_url":"https://api.github.com/repos/selansen/moby/releases{/id}","deployments_url":"https://api.github.com/repos/selansen/moby/deployments","created_at":"2017-11-29T21:13:12Z","updated_at":"2017-11-29T21:13:25Z","pushed_at":"2018-02-24T03:18:28Z","git_url":"git://github.com/selansen/moby.git","ssh_url":"git@github.com:selansen/moby.git","clone_url":"https://github.com/selansen/moby.git","svn_url":"https://github.com/selansen/moby","homepage":"https://mobyproject.org/","size":136430,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"moby:master","ref":"master","sha":"4d9beb4607404e4d756052aca7041517788f7e75","user":{"login":"moby","id":27259197,"avatar_url":"https://avatars1.githubusercontent.com/u/27259197?v=4","gravatar_id":"","url":"https://api.github.com/users/moby","html_url":"https://github.com/moby","followers_url":"https://api.github.com/users/moby/followers","following_url":"https://api.github.com/users/moby/following{/other_user}","gists_url":"https://api.github.com/users/moby/gists{/gist_id}","starred_url":"https://api.github.com/users/moby/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/moby/subscriptions","organizations_url":"https://api.github.com/users/moby/orgs","repos_url":"https://api.github.com/users/moby/repos","events_url":"https://api.github.com/users/moby/events{/privacy}","received_events_url":"https://api.github.com/users/moby/received_events","type":"Organization","site_admin":false},"repo":{"id":7691631,"name":"moby","full_name":"moby/moby","owner":{"login":"moby","id":27259197,"avatar_url":"https://avatars1.githubusercontent.com/u/27259197?v=4","gravatar_id":"","url":"https://api.github.com/users/moby","html_url":"https://github.com/moby","followers_url":"https://api.github.com/users/moby/followers","following_url":"https://api.github.com/users/moby/following{/other_user}","gists_url":"https://api.github.com/users/moby/gists{/gist_id}","starred_url":"https://api.github.com/users/moby/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/moby/subscriptions","organizations_url":"https://api.github.com/users/moby/orgs","repos_url":"https://api.github.com/users/moby/repos","events_url":"https://api.github.com/users/moby/events{/privacy}","received_events_url":"https://api.github.com/users/moby/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/moby/moby","description":"Moby Project - a collaborative project for the container ecosystem to assemble container-based systems","fork":false,"url":"https://api.github.com/repos/moby/moby","forks_url":"https://api.github.com/repos/moby/moby/forks","keys_url":"https://api.github.com/repos/moby/moby/keys{/key_id}","collaborators_url":"https://api.github.com/repos/moby/moby/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/moby/moby/teams","hooks_url":"https://api.github.com/repos/moby/moby/hooks","issue_events_url":"https://api.github.com/repos/moby/moby/issues/events{/number}","events_url":"https://api.github.com/repos/moby/moby/events","assignees_url":"https://api.github.com/repos/moby/moby/assignees{/user}","branches_url":"https://api.github.com/repos/moby/moby/branches{/branch}","tags_url":"https://api.github.com/repos/moby/moby/tags","blobs_url":"https://api.github.com/repos/moby/moby/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/moby/moby/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/moby/moby/git/refs{/sha}","trees_url":"https://api.github.com/repos/moby/moby/git/trees{/sha}","statuses_url":"https://api.github.com/repos/moby/moby/statuses/{sha}","languages_url":"https://api.github.com/repos/moby/moby/languages","stargazers_url":"https://api.github.com/repos/moby/moby/stargazers","contributors_url":"https://api.github.com/repos/moby/moby/contributors","subscribers_url":"https://api.github.com/repos/moby/moby/subscribers","subscription_url":"https://api.github.com/repos/moby/moby/subscription","commits_url":"https://api.github.com/repos/moby/moby/commits{/sha}","git_commits_url":"https://api.github.com/repos/moby/moby/git/commits{/sha}","comments_url":"https://api.github.com/repos/moby/moby/comments{/number}","issue_comment_url":"https://api.github.com/repos/moby/moby/issues/comments{/number}","contents_url":"https://api.github.com/repos/moby/moby/contents/{+path}","compare_url":"https://api.github.com/repos/moby/moby/compare/{base}...{head}","merges_url":"https://api.github.com/repos/moby/moby/merges","archive_url":"https://api.github.com/repos/moby/moby/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/moby/moby/downloads","issues_url":"https://api.github.com/repos/moby/moby/issues{/number}","pulls_url":"https://api.github.com/repos/moby/moby/pulls{/number}","milestones_url":"https://api.github.com/repos/moby/moby/milestones{/number}","notifications_url":"https://api.github.com/repos/moby/moby/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/moby/moby/labels{/name}","releases_url":"https://api.github.com/repos/moby/moby/releases{/id}","deployments_url":"https://api.github.com/repos/moby/moby/deployments","created_at":"2013-01-18T18:10:57Z","updated_at":"2018-02-26T20:48:36Z","pushed_at":"2018-02-26T20:36:51Z","git_url":"git://github.com/moby/moby.git","ssh_url":"git@github.com:moby/moby.git","clone_url":"https://github.com/moby/moby.git","svn_url":"https://github.com/moby/moby","homepage":"https://mobyproject.org/","size":136467,"stargazers_count":47775,"watchers_count":47775,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":14092,"mirror_url":null,"archived":false,"open_issues_count":3062,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":14092,"open_issues":3062,"watchers":47775,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/moby/moby/pulls/36396"},"html":{"href":"https://github.com/moby/moby/pull/36396"},"issue":{"href":"https://api.github.com/repos/moby/moby/issues/36396"},"comments":{"href":"https://api.github.com/repos/moby/moby/issues/36396/comments"},"review_comments":{"href":"https://api.github.com/repos/moby/moby/pulls/36396/comments"},"review_comment":{"href":"https://api.github.com/repos/moby/moby/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/moby/moby/pulls/36396/commits"},"statuses":{"href":"https://api.github.com/repos/moby/moby/statuses/b167eddfdd38bf28db3a342e9416af949e9d1daa"}},"author_association":"NONE"}}
{"actor":{"display_login":"selansen"}}