{"action":"created","comment":{"url":"https://api.github.com/repos/chenchun/libnetwork/pulls/comments/38550433","id":38550433,"diff_hunk":"@@ -69,6 +69,8 @@ type NetworkController interface {\n \t// ConfigureNetworkDriver applies the passed options to the driver instance for the specified network type\n \tConfigureNetworkDriver(networkType string, options map[string]interface{}) error","path":"controller.go","position":2,"original_position":2,"commit_id":"945fce7df75dbd54f34911f38fc6f69de73f82f3","original_commit_id":"945fce7df75dbd54f34911f38fc6f69de73f82f3","user":{"login":"chenchun","id":985861,"avatar_url":"https://avatars.githubusercontent.com/u/985861?v=3","gravatar_id":"","url":"https://api.github.com/users/chenchun","html_url":"https://github.com/chenchun","followers_url":"https://api.github.com/users/chenchun/followers","following_url":"https://api.github.com/users/chenchun/following{/other_user}","gists_url":"https://api.github.com/users/chenchun/gists{/gist_id}","starred_url":"https://api.github.com/users/chenchun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chenchun/subscriptions","organizations_url":"https://api.github.com/users/chenchun/orgs","repos_url":"https://api.github.com/users/chenchun/repos","events_url":"https://api.github.com/users/chenchun/events{/privacy}","received_events_url":"https://api.github.com/users/chenchun/received_events","type":"User","site_admin":false},"body":"How can drivers handle `ConfigureNetworkDriver` in the between the `New()` and `Start()`? For bridge driver, if users changed `EnableIPForwarding` from true to false, it seems bridge driver will ignore this? ","created_at":"2015-09-02T16:01:37Z","updated_at":"2015-09-02T16:01:37Z","html_url":"https://github.com/chenchun/libnetwork/pull/1#discussion_r38550433","pull_request_url":"https://api.github.com/repos/chenchun/libnetwork/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/chenchun/libnetwork/pulls/comments/38550433"},"html":{"href":"https://github.com/chenchun/libnetwork/pull/1#discussion_r38550433"},"pull_request":{"href":"https://api.github.com/repos/chenchun/libnetwork/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/chenchun/libnetwork/pulls/1","id":43995984,"html_url":"https://github.com/chenchun/libnetwork/pull/1","diff_url":"https://github.com/chenchun/libnetwork/pull/1.diff","patch_url":"https://github.com/chenchun/libnetwork/pull/1.patch","issue_url":"https://api.github.com/repos/chenchun/libnetwork/issues/1","number":1,"state":"open","locked":false,"title":"Handling default networks (bridge, null, host) with local store","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":"Pushing this fix to chenchun's branch to make it easy to update \r\nthe PR https://github.com/docker/libnetwork/pull/466.\r\nPlease test it out before merging it in your branch.\r\n\r\nWith the introduction of Local store, we store all the networks and\r\nendpoints created for all the locally scoped objects.\r\nBut, the default networks are special. On daemon start, docker will\r\ninstall the 3 default networks (docker0 bridge, null and host). But,\r\nsince we restore the networks from the local store in controller.New()\r\nthe actual network creation from Daemon will fail. Hence, we need to\r\nhandle that scenario. To add more to it, the user could have changed\r\nthe bridge configuration in docker daemon configuration. Hence the\r\nNewNetwork call from the docker daemon must be honored and at the same\r\ntime we have to retain the network ID and endpoints stored in the\r\nlocal-db.\r\n\r\nThe solution is to introduce a new state called `started` for the\r\ncontroller & playback the network and endpoint states from the datastore\r\nonly when the Start() is called. Between the New() and Start(), the\r\nDaemon can create the special networks which will be adjusted with the\r\nlocal states & installed by merging the latest configs with the saved\r\ndata.\r\n\r\nSigned-off-by: Madhu Venugopal <madhu@docker.com>","created_at":"2015-09-02T14:09:09Z","updated_at":"2015-09-02T16:01:37Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7c344bbdfd7d64c334327da4f6909157e6afca68","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/chenchun/libnetwork/pulls/1/commits","review_comments_url":"https://api.github.com/repos/chenchun/libnetwork/pulls/1/comments","review_comment_url":"https://api.github.com/repos/chenchun/libnetwork/pulls/comments{/number}","comments_url":"https://api.github.com/repos/chenchun/libnetwork/issues/1/comments","statuses_url":"https://api.github.com/repos/chenchun/libnetwork/statuses/945fce7df75dbd54f34911f38fc6f69de73f82f3","head":{"label":"mavenugo:localstore_fix","ref":"localstore_fix","sha":"945fce7df75dbd54f34911f38fc6f69de73f82f3","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},"repo":{"id":34572010,"name":"libnetwork","full_name":"mavenugo/libnetwork","owner":{"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},"private":false,"html_url":"https://github.com/mavenugo/libnetwork","description":"networking for containers","fork":true,"url":"https://api.github.com/repos/mavenugo/libnetwork","forks_url":"https://api.github.com/repos/mavenugo/libnetwork/forks","keys_url":"https://api.github.com/repos/mavenugo/libnetwork/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mavenugo/libnetwork/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mavenugo/libnetwork/teams","hooks_url":"https://api.github.com/repos/mavenugo/libnetwork/hooks","issue_events_url":"https://api.github.com/repos/mavenugo/libnetwork/issues/events{/number}","events_url":"https://api.github.com/repos/mavenugo/libnetwork/events","assignees_url":"https://api.github.com/repos/mavenugo/libnetwork/assignees{/user}","branches_url":"https://api.github.com/repos/mavenugo/libnetwork/branches{/branch}","tags_url":"https://api.github.com/repos/mavenugo/libnetwork/tags","blobs_url":"https://api.github.com/repos/mavenugo/libnetwork/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mavenugo/libnetwork/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mavenugo/libnetwork/git/refs{/sha}","trees_url":"https://api.github.com/repos/mavenugo/libnetwork/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mavenugo/libnetwork/statuses/{sha}","languages_url":"https://api.github.com/repos/mavenugo/libnetwork/languages","stargazers_url":"https://api.github.com/repos/mavenugo/libnetwork/stargazers","contributors_url":"https://api.github.com/repos/mavenugo/libnetwork/contributors","subscribers_url":"https://api.github.com/repos/mavenugo/libnetwork/subscribers","subscription_url":"https://api.github.com/repos/mavenugo/libnetwork/subscription","commits_url":"https://api.github.com/repos/mavenugo/libnetwork/commits{/sha}","git_commits_url":"https://api.github.com/repos/mavenugo/libnetwork/git/commits{/sha}","comments_url":"https://api.github.com/repos/mavenugo/libnetwork/comments{/number}","issue_comment_url":"https://api.github.com/repos/mavenugo/libnetwork/issues/comments{/number}","contents_url":"https://api.github.com/repos/mavenugo/libnetwork/contents/{+path}","compare_url":"https://api.github.com/repos/mavenugo/libnetwork/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mavenugo/libnetwork/merges","archive_url":"https://api.github.com/repos/mavenugo/libnetwork/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mavenugo/libnetwork/downloads","issues_url":"https://api.github.com/repos/mavenugo/libnetwork/issues{/number}","pulls_url":"https://api.github.com/repos/mavenugo/libnetwork/pulls{/number}","milestones_url":"https://api.github.com/repos/mavenugo/libnetwork/milestones{/number}","notifications_url":"https://api.github.com/repos/mavenugo/libnetwork/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mavenugo/libnetwork/labels{/name}","releases_url":"https://api.github.com/repos/mavenugo/libnetwork/releases{/id}","created_at":"2015-04-25T14:39:45Z","updated_at":"2015-05-07T18:56:18Z","pushed_at":"2015-09-02T15:47:38Z","git_url":"git://github.com/mavenugo/libnetwork.git","ssh_url":"git@github.com:mavenugo/libnetwork.git","clone_url":"https://github.com/mavenugo/libnetwork.git","svn_url":"https://github.com/mavenugo/libnetwork","homepage":"","size":5686,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":0,"forks":2,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"chenchun:localstore","ref":"localstore","sha":"6d90d3eae7c356970e59109be17a3b8a8bee3c36","user":{"login":"chenchun","id":985861,"avatar_url":"https://avatars.githubusercontent.com/u/985861?v=3","gravatar_id":"","url":"https://api.github.com/users/chenchun","html_url":"https://github.com/chenchun","followers_url":"https://api.github.com/users/chenchun/followers","following_url":"https://api.github.com/users/chenchun/following{/other_user}","gists_url":"https://api.github.com/users/chenchun/gists{/gist_id}","starred_url":"https://api.github.com/users/chenchun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chenchun/subscriptions","organizations_url":"https://api.github.com/users/chenchun/orgs","repos_url":"https://api.github.com/users/chenchun/repos","events_url":"https://api.github.com/users/chenchun/events{/privacy}","received_events_url":"https://api.github.com/users/chenchun/received_events","type":"User","site_admin":false},"repo":{"id":37978498,"name":"libnetwork","full_name":"chenchun/libnetwork","owner":{"login":"chenchun","id":985861,"avatar_url":"https://avatars.githubusercontent.com/u/985861?v=3","gravatar_id":"","url":"https://api.github.com/users/chenchun","html_url":"https://github.com/chenchun","followers_url":"https://api.github.com/users/chenchun/followers","following_url":"https://api.github.com/users/chenchun/following{/other_user}","gists_url":"https://api.github.com/users/chenchun/gists{/gist_id}","starred_url":"https://api.github.com/users/chenchun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chenchun/subscriptions","organizations_url":"https://api.github.com/users/chenchun/orgs","repos_url":"https://api.github.com/users/chenchun/repos","events_url":"https://api.github.com/users/chenchun/events{/privacy}","received_events_url":"https://api.github.com/users/chenchun/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/chenchun/libnetwork","description":"networking for containers","fork":true,"url":"https://api.github.com/repos/chenchun/libnetwork","forks_url":"https://api.github.com/repos/chenchun/libnetwork/forks","keys_url":"https://api.github.com/repos/chenchun/libnetwork/keys{/key_id}","collaborators_url":"https://api.github.com/repos/chenchun/libnetwork/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/chenchun/libnetwork/teams","hooks_url":"https://api.github.com/repos/chenchun/libnetwork/hooks","issue_events_url":"https://api.github.com/repos/chenchun/libnetwork/issues/events{/number}","events_url":"https://api.github.com/repos/chenchun/libnetwork/events","assignees_url":"https://api.github.com/repos/chenchun/libnetwork/assignees{/user}","branches_url":"https://api.github.com/repos/chenchun/libnetwork/branches{/branch}","tags_url":"https://api.github.com/repos/chenchun/libnetwork/tags","blobs_url":"https://api.github.com/repos/chenchun/libnetwork/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/chenchun/libnetwork/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/chenchun/libnetwork/git/refs{/sha}","trees_url":"https://api.github.com/repos/chenchun/libnetwork/git/trees{/sha}","statuses_url":"https://api.github.com/repos/chenchun/libnetwork/statuses/{sha}","languages_url":"https://api.github.com/repos/chenchun/libnetwork/languages","stargazers_url":"https://api.github.com/repos/chenchun/libnetwork/stargazers","contributors_url":"https://api.github.com/repos/chenchun/libnetwork/contributors","subscribers_url":"https://api.github.com/repos/chenchun/libnetwork/subscribers","subscription_url":"https://api.github.com/repos/chenchun/libnetwork/subscription","commits_url":"https://api.github.com/repos/chenchun/libnetwork/commits{/sha}","git_commits_url":"https://api.github.com/repos/chenchun/libnetwork/git/commits{/sha}","comments_url":"https://api.github.com/repos/chenchun/libnetwork/comments{/number}","issue_comment_url":"https://api.github.com/repos/chenchun/libnetwork/issues/comments{/number}","contents_url":"https://api.github.com/repos/chenchun/libnetwork/contents/{+path}","compare_url":"https://api.github.com/repos/chenchun/libnetwork/compare/{base}...{head}","merges_url":"https://api.github.com/repos/chenchun/libnetwork/merges","archive_url":"https://api.github.com/repos/chenchun/libnetwork/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/chenchun/libnetwork/downloads","issues_url":"https://api.github.com/repos/chenchun/libnetwork/issues{/number}","pulls_url":"https://api.github.com/repos/chenchun/libnetwork/pulls{/number}","milestones_url":"https://api.github.com/repos/chenchun/libnetwork/milestones{/number}","notifications_url":"https://api.github.com/repos/chenchun/libnetwork/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/chenchun/libnetwork/labels{/name}","releases_url":"https://api.github.com/repos/chenchun/libnetwork/releases{/id}","created_at":"2015-06-24T10:36:27Z","updated_at":"2015-06-24T10:36:28Z","pushed_at":"2015-09-02T14:09:09Z","git_url":"git://github.com/chenchun/libnetwork.git","ssh_url":"git@github.com:chenchun/libnetwork.git","clone_url":"https://github.com/chenchun/libnetwork.git","svn_url":"https://github.com/chenchun/libnetwork","homepage":"","size":5272,"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":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/chenchun/libnetwork/pulls/1"},"html":{"href":"https://github.com/chenchun/libnetwork/pull/1"},"issue":{"href":"https://api.github.com/repos/chenchun/libnetwork/issues/1"},"comments":{"href":"https://api.github.com/repos/chenchun/libnetwork/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/chenchun/libnetwork/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/chenchun/libnetwork/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/chenchun/libnetwork/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/chenchun/libnetwork/statuses/945fce7df75dbd54f34911f38fc6f69de73f82f3"}}}}