{"action":"created","comment":{"url":"https://api.github.com/repos/docker/docker/pulls/comments/49095427","id":49095427,"diff_hunk":"@@ -622,28 +652,14 @@ func (daemon *Daemon) ConnectToNetwork(container *container.Container, idOrName\n }\n \n func (daemon *Daemon) connectToNetwork(container *container.Container, idOrName string, updateSettings bool) (err error) {\n-\tif container.HostConfig.NetworkMode.IsContainer() {\n-\t\treturn runconfig.ErrConflictSharedNetwork\n-\t}\n-\n-\tif containertypes.NetworkMode(idOrName).IsBridge() &&\n-\t\tdaemon.configStore.DisableBridge {\n-\t\tcontainer.Config.NetworkDisabled = true\n-\t\treturn nil\n-\t}\n-\n-\tcontroller := daemon.netController\n-\n-\tn, err := daemon.FindNetwork(idOrName)\n+\tn, err := daemon.updateNetworks(container, idOrName, updateSettings)","path":"daemon/container_operations_unix.go","position":59,"original_position":59,"commit_id":"430b24cb10b288bb6dde230faeb367e188bd2ab9","original_commit_id":"430b24cb10b288bb6dde230faeb367e188bd2ab9","user":{"login":"mavenugo","id":5056191,"avatar_url":"https://avatars.githubusercontent.com/u/5056191?v=3","gravatar_id":"","url":"https://api.github.com/users/mavenugo","html_url":"https://github.com/mavenugo","followers_url":"https://api.github.com/users/mavenugo/followers","following_url":"https://api.github.com/users/mavenugo/following{/other_user}","gists_url":"https://api.github.com/users/mavenugo/gists{/gist_id}","starred_url":"https://api.github.com/users/mavenugo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mavenugo/subscriptions","organizations_url":"https://api.github.com/users/mavenugo/orgs","repos_url":"https://api.github.com/users/mavenugo/repos","events_url":"https://api.github.com/users/mavenugo/events{/privacy}","received_events_url":"https://api.github.com/users/mavenugo/received_events","type":"User","site_admin":false},"body":"That's not true. please note the subtle difference in the function name (I should be blamed there).\r\n`ConnectToNetwork` is called from `network connect` UX. while `connectToNetwork` is a common function called both from `ConnectToNetwork` and `AllocateNetwork` (which is the entry point for `docker run --net`).\r\n\r\nSo we cannot remove this call from here (to handle the `docker run` cases).\r\n\r\nHence, we have to be careful in doing the change that you suggested above https://github.com/docker/docker/pull/18906/files#r49092752.","created_at":"2016-01-07T16:53:35Z","updated_at":"2016-01-07T16:53:35Z","html_url":"https://github.com/docker/docker/pull/18906#discussion_r49095427","pull_request_url":"https://api.github.com/repos/docker/docker/pulls/18906","_links":{"self":{"href":"https://api.github.com/repos/docker/docker/pulls/comments/49095427"},"html":{"href":"https://github.com/docker/docker/pull/18906#discussion_r49095427"},"pull_request":{"href":"https://api.github.com/repos/docker/docker/pulls/18906"}}},"pull_request":{"url":"https://api.github.com/repos/docker/docker/pulls/18906","id":54577924,"html_url":"https://github.com/docker/docker/pull/18906","diff_url":"https://github.com/docker/docker/pull/18906.diff","patch_url":"https://github.com/docker/docker/pull/18906.patch","issue_url":"https://api.github.com/repos/docker/docker/issues/18906","number":18906,"state":"open","locked":false,"title":"Support network connect/disconnect to stopped container","user":{"login":"coolljt0725","id":8232360,"avatar_url":"https://avatars.githubusercontent.com/u/8232360?v=3","gravatar_id":"","url":"https://api.github.com/users/coolljt0725","html_url":"https://github.com/coolljt0725","followers_url":"https://api.github.com/users/coolljt0725/followers","following_url":"https://api.github.com/users/coolljt0725/following{/other_user}","gists_url":"https://api.github.com/users/coolljt0725/gists{/gist_id}","starred_url":"https://api.github.com/users/coolljt0725/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/coolljt0725/subscriptions","organizations_url":"https://api.github.com/users/coolljt0725/orgs","repos_url":"https://api.github.com/users/coolljt0725/repos","events_url":"https://api.github.com/users/coolljt0725/events{/privacy}","received_events_url":"https://api.github.com/users/coolljt0725/received_events","type":"User","site_admin":false},"body":"Signed-off-by: Lei Jitang <leijitang@huawei.com>\r\n\r\nsee #17796 \r\nping @mavenugo ","created_at":"2015-12-25T07:27:48Z","updated_at":"2016-01-07T16:53:35Z","closed_at":null,"merged_at":null,"merge_commit_sha":"bf645db906a638582289a099876f9fcfc6cfbc9e","assignee":null,"milestone":{"url":"https://api.github.com/repos/docker/docker/milestones/44","html_url":"https://github.com/docker/docker/milestones/1.10.0","labels_url":"https://api.github.com/repos/docker/docker/milestones/44/labels","id":1351533,"number":44,"title":"1.10.0","description":"Code freeze / feature freeze January 14th 2016\r\nPlanned release: February 4th, 2016\r\nhttps://github.com/docker/docker/wiki","creator":{"login":"thaJeztah","id":1804568,"avatar_url":"https://avatars.githubusercontent.com/u/1804568?v=3","gravatar_id":"","url":"https://api.github.com/users/thaJeztah","html_url":"https://github.com/thaJeztah","followers_url":"https://api.github.com/users/thaJeztah/followers","following_url":"https://api.github.com/users/thaJeztah/following{/other_user}","gists_url":"https://api.github.com/users/thaJeztah/gists{/gist_id}","starred_url":"https://api.github.com/users/thaJeztah/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thaJeztah/subscriptions","organizations_url":"https://api.github.com/users/thaJeztah/orgs","repos_url":"https://api.github.com/users/thaJeztah/repos","events_url":"https://api.github.com/users/thaJeztah/events{/privacy}","received_events_url":"https://api.github.com/users/thaJeztah/received_events","type":"User","site_admin":false},"open_issues":38,"closed_issues":86,"state":"open","created_at":"2015-10-12T18:21:55Z","updated_at":"2016-01-07T16:23:11Z","due_on":"2016-01-13T23:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/docker/docker/pulls/18906/commits","review_comments_url":"https://api.github.com/repos/docker/docker/pulls/18906/comments","review_comment_url":"https://api.github.com/repos/docker/docker/pulls/comments{/number}","comments_url":"https://api.github.com/repos/docker/docker/issues/18906/comments","statuses_url":"https://api.github.com/repos/docker/docker/statuses/430b24cb10b288bb6dde230faeb367e188bd2ab9","head":{"label":"coolljt0725:connect_to_created","ref":"connect_to_created","sha":"430b24cb10b288bb6dde230faeb367e188bd2ab9","user":{"login":"coolljt0725","id":8232360,"avatar_url":"https://avatars.githubusercontent.com/u/8232360?v=3","gravatar_id":"","url":"https://api.github.com/users/coolljt0725","html_url":"https://github.com/coolljt0725","followers_url":"https://api.github.com/users/coolljt0725/followers","following_url":"https://api.github.com/users/coolljt0725/following{/other_user}","gists_url":"https://api.github.com/users/coolljt0725/gists{/gist_id}","starred_url":"https://api.github.com/users/coolljt0725/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/coolljt0725/subscriptions","organizations_url":"https://api.github.com/users/coolljt0725/orgs","repos_url":"https://api.github.com/users/coolljt0725/repos","events_url":"https://api.github.com/users/coolljt0725/events{/privacy}","received_events_url":"https://api.github.com/users/coolljt0725/received_events","type":"User","site_admin":false},"repo":{"id":24972258,"name":"docker","full_name":"coolljt0725/docker","owner":{"login":"coolljt0725","id":8232360,"avatar_url":"https://avatars.githubusercontent.com/u/8232360?v=3","gravatar_id":"","url":"https://api.github.com/users/coolljt0725","html_url":"https://github.com/coolljt0725","followers_url":"https://api.github.com/users/coolljt0725/followers","following_url":"https://api.github.com/users/coolljt0725/following{/other_user}","gists_url":"https://api.github.com/users/coolljt0725/gists{/gist_id}","starred_url":"https://api.github.com/users/coolljt0725/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/coolljt0725/subscriptions","organizations_url":"https://api.github.com/users/coolljt0725/orgs","repos_url":"https://api.github.com/users/coolljt0725/repos","events_url":"https://api.github.com/users/coolljt0725/events{/privacy}","received_events_url":"https://api.github.com/users/coolljt0725/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/coolljt0725/docker","description":"Docker - the open-source application container engine","fork":true,"url":"https://api.github.com/repos/coolljt0725/docker","forks_url":"https://api.github.com/repos/coolljt0725/docker/forks","keys_url":"https://api.github.com/repos/coolljt0725/docker/keys{/key_id}","collaborators_url":"https://api.github.com/repos/coolljt0725/docker/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/coolljt0725/docker/teams","hooks_url":"https://api.github.com/repos/coolljt0725/docker/hooks","issue_events_url":"https://api.github.com/repos/coolljt0725/docker/issues/events{/number}","events_url":"https://api.github.com/repos/coolljt0725/docker/events","assignees_url":"https://api.github.com/repos/coolljt0725/docker/assignees{/user}","branches_url":"https://api.github.com/repos/coolljt0725/docker/branches{/branch}","tags_url":"https://api.github.com/repos/coolljt0725/docker/tags","blobs_url":"https://api.github.com/repos/coolljt0725/docker/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/coolljt0725/docker/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/coolljt0725/docker/git/refs{/sha}","trees_url":"https://api.github.com/repos/coolljt0725/docker/git/trees{/sha}","statuses_url":"https://api.github.com/repos/coolljt0725/docker/statuses/{sha}","languages_url":"https://api.github.com/repos/coolljt0725/docker/languages","stargazers_url":"https://api.github.com/repos/coolljt0725/docker/stargazers","contributors_url":"https://api.github.com/repos/coolljt0725/docker/contributors","subscribers_url":"https://api.github.com/repos/coolljt0725/docker/subscribers","subscription_url":"https://api.github.com/repos/coolljt0725/docker/subscription","commits_url":"https://api.github.com/repos/coolljt0725/docker/commits{/sha}","git_commits_url":"https://api.github.com/repos/coolljt0725/docker/git/commits{/sha}","comments_url":"https://api.github.com/repos/coolljt0725/docker/comments{/number}","issue_comment_url":"https://api.github.com/repos/coolljt0725/docker/issues/comments{/number}","contents_url":"https://api.github.com/repos/coolljt0725/docker/contents/{+path}","compare_url":"https://api.github.com/repos/coolljt0725/docker/compare/{base}...{head}","merges_url":"https://api.github.com/repos/coolljt0725/docker/merges","archive_url":"https://api.github.com/repos/coolljt0725/docker/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/coolljt0725/docker/downloads","issues_url":"https://api.github.com/repos/coolljt0725/docker/issues{/number}","pulls_url":"https://api.github.com/repos/coolljt0725/docker/pulls{/number}","milestones_url":"https://api.github.com/repos/coolljt0725/docker/milestones{/number}","notifications_url":"https://api.github.com/repos/coolljt0725/docker/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/coolljt0725/docker/labels{/name}","releases_url":"https://api.github.com/repos/coolljt0725/docker/releases{/id}","created_at":"2014-10-09T03:32:31Z","updated_at":"2015-03-28T01:04:57Z","pushed_at":"2016-01-07T11:48:03Z","git_url":"git://github.com/coolljt0725/docker.git","ssh_url":"git@github.com:coolljt0725/docker.git","clone_url":"https://github.com/coolljt0725/docker.git","svn_url":"https://github.com/coolljt0725/docker","homepage":"http://www.docker.com","size":78489,"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":"78ce43bad85fdf97d7c836315e46b531901c8ae7","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":7691631,"name":"docker","full_name":"docker/docker","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/docker","description":"Docker - the open-source application container engine","fork":false,"url":"https://api.github.com/repos/docker/docker","forks_url":"https://api.github.com/repos/docker/docker/forks","keys_url":"https://api.github.com/repos/docker/docker/keys{/key_id}","collaborators_url":"https://api.github.com/repos/docker/docker/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/docker/docker/teams","hooks_url":"https://api.github.com/repos/docker/docker/hooks","issue_events_url":"https://api.github.com/repos/docker/docker/issues/events{/number}","events_url":"https://api.github.com/repos/docker/docker/events","assignees_url":"https://api.github.com/repos/docker/docker/assignees{/user}","branches_url":"https://api.github.com/repos/docker/docker/branches{/branch}","tags_url":"https://api.github.com/repos/docker/docker/tags","blobs_url":"https://api.github.com/repos/docker/docker/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/docker/docker/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/docker/docker/git/refs{/sha}","trees_url":"https://api.github.com/repos/docker/docker/git/trees{/sha}","statuses_url":"https://api.github.com/repos/docker/docker/statuses/{sha}","languages_url":"https://api.github.com/repos/docker/docker/languages","stargazers_url":"https://api.github.com/repos/docker/docker/stargazers","contributors_url":"https://api.github.com/repos/docker/docker/contributors","subscribers_url":"https://api.github.com/repos/docker/docker/subscribers","subscription_url":"https://api.github.com/repos/docker/docker/subscription","commits_url":"https://api.github.com/repos/docker/docker/commits{/sha}","git_commits_url":"https://api.github.com/repos/docker/docker/git/commits{/sha}","comments_url":"https://api.github.com/repos/docker/docker/comments{/number}","issue_comment_url":"https://api.github.com/repos/docker/docker/issues/comments{/number}","contents_url":"https://api.github.com/repos/docker/docker/contents/{+path}","compare_url":"https://api.github.com/repos/docker/docker/compare/{base}...{head}","merges_url":"https://api.github.com/repos/docker/docker/merges","archive_url":"https://api.github.com/repos/docker/docker/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/docker/docker/downloads","issues_url":"https://api.github.com/repos/docker/docker/issues{/number}","pulls_url":"https://api.github.com/repos/docker/docker/pulls{/number}","milestones_url":"https://api.github.com/repos/docker/docker/milestones{/number}","notifications_url":"https://api.github.com/repos/docker/docker/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/docker/docker/labels{/name}","releases_url":"https://api.github.com/repos/docker/docker/releases{/id}","created_at":"2013-01-18T18:10:57Z","updated_at":"2016-01-07T16:24:56Z","pushed_at":"2016-01-07T16:37:21Z","git_url":"git://github.com/docker/docker.git","ssh_url":"git@github.com:docker/docker.git","clone_url":"https://github.com/docker/docker.git","svn_url":"https://github.com/docker/docker","homepage":"http://www.docker.com","size":121991,"stargazers_count":27577,"watchers_count":27577,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":7591,"mirror_url":null,"open_issues_count":1276,"forks":7591,"open_issues":1276,"watchers":27577,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/docker/docker/pulls/18906"},"html":{"href":"https://github.com/docker/docker/pull/18906"},"issue":{"href":"https://api.github.com/repos/docker/docker/issues/18906"},"comments":{"href":"https://api.github.com/repos/docker/docker/issues/18906/comments"},"review_comments":{"href":"https://api.github.com/repos/docker/docker/pulls/18906/comments"},"review_comment":{"href":"https://api.github.com/repos/docker/docker/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/docker/docker/pulls/18906/commits"},"statuses":{"href":"https://api.github.com/repos/docker/docker/statuses/430b24cb10b288bb6dde230faeb367e188bd2ab9"}}}}