{"action":"closed","number":18810,"pull_request":{"url":"https://api.github.com/repos/docker/docker/pulls/18810","id":54206062,"html_url":"https://github.com/docker/docker/pull/18810","diff_url":"https://github.com/docker/docker/pull/18810.diff","patch_url":"https://github.com/docker/docker/pull/18810.patch","issue_url":"https://api.github.com/repos/docker/docker/issues/18810","number":18810,"state":"closed","locked":false,"title":"pkg: authorization: do not register the same plugin","user":{"login":"runcom","id":849915,"avatar_url":"https://avatars.githubusercontent.com/u/849915?v=3","gravatar_id":"","url":"https://api.github.com/users/runcom","html_url":"https://github.com/runcom","followers_url":"https://api.github.com/users/runcom/followers","following_url":"https://api.github.com/users/runcom/following{/other_user}","gists_url":"https://api.github.com/users/runcom/gists{/gist_id}","starred_url":"https://api.github.com/users/runcom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/runcom/subscriptions","organizations_url":"https://api.github.com/users/runcom/orgs","repos_url":"https://api.github.com/users/runcom/repos","events_url":"https://api.github.com/users/runcom/events{/privacy}","received_events_url":"https://api.github.com/users/runcom/received_events","type":"User","site_admin":false},"body":"This patches avoids registering (and calling) the same plugin more than\r\nonce. Using a map indexing by name guarantees this. We shouldn't bother\r\nabout Golang internal random map loop because we actually don't care\r\nabout plugins order. If we do, I think a better approach is to think\r\nabout plugins priorities, but this is another story.\r\nThe behavior of overriding the same name in a flag is consistent with,\r\nfor instance, the `docker run -v /test -v /test` flag which register\r\nthe volume just once.\r\nAdds integration tests.\r\n\r\nWithout this patch:\r\n```\r\nDec 20 19:34:52 localhost.localdomain docker[9988]:\r\ntime=\"2015-12-20T19:34:52.080901676+01:00\" level=debug msg=\"Calling\r\nGET\r\n/v1.22/info\"\r\nDec 20 19:34:52 localhost.localdomain docker[9988]:\r\ntime=\"2015-12-20T19:34:52.081213202+01:00\" level=debug msg=\"AuthZ\r\nrequest using plugin docker-novolume-plugin\"\r\nDec 20 19:34:52 localhost.localdomain docker[9988]:\r\ntime=\"2015-12-20T19:34:52.081268132+01:00\" level=debug\r\nmsg=\"docker-novolume-plugin implements: authz\"\r\nDec 20 19:34:52 localhost.localdomain docker[9988]:\r\ntime=\"2015-12-20T19:34:52.081699788+01:00\" level=debug msg=\"AuthZ\r\nrequest using plugin docker-novolume-plugin\"\r\nDec 20 19:34:52 localhost.localdomain docker[9988]:\r\ntime=\"2015-12-20T19:34:52.081762507+01:00\" level=debug\r\nmsg=\"docker-novolume-plugin implements: authz\"\r\nDec 20 19:34:52 localhost.localdomain docker[9988]:\r\ntime=\"2015-12-20T19:34:52.082092480+01:00\" level=debug msg=\"GET\r\n/v1.22/info\"\r\nDec 20 19:34:52 localhost.localdomain docker[9988]:\r\ntime=\"2015-12-20T19:34:52.628691038+01:00\" level=debug msg=\"AuthZ\r\nresponse using plugin docker-novolume-plugin\"\r\nDec 20 19:34:52 localhost.localdomain docker[9988]:\r\ntime=\"2015-12-20T19:34:52.629880930+01:00\" level=debug msg=\"AuthZ\r\nresponse using plugin docker-novolume-plugin\"\r\n```\r\n\r\nWith this patch:\r\n```\r\nDec 20 19:37:32 localhost.localdomain docker[16620]:\r\ntime=\"2015-12-20T19:37:32.376523958+01:00\" level=debug msg=\"Calling\r\nGET\r\n/v1.22/info\"\r\nDec 20 19:37:32 localhost.localdomain docker[16620]:\r\ntime=\"2015-12-20T19:37:32.376715483+01:00\" level=debug msg=\"AuthZ\r\nrequest using plugin docker-novolume-plugin\"\r\nDec 20 19:37:32 localhost.localdomain docker[16620]:\r\ntime=\"2015-12-20T19:37:32.376771230+01:00\" level=debug\r\nmsg=\"docker-novolume-plugin implements: authz\"\r\nDec 20 19:37:32 localhost.localdomain docker[16620]:\r\ntime=\"2015-12-20T19:37:32.377698897+01:00\" level=debug msg=\"GET\r\n/v1.22/info\"\r\nDec 20 19:37:32 localhost.localdomain docker[16620]:\r\ntime=\"2015-12-20T19:37:32.951016441+01:00\" level=debug msg=\"AuthZ\r\nresponse using plugin docker-novolume-plugin\"\r\n```\r\n\r\nAlso removes a somehow duplicate debug statement (leaving only the\r\nsecond one as it's a loop of plugin's manifest):\r\n```\r\nDec 20 19:52:30 localhost.localdomain docker[25767]:\r\ntime=\"2015-12-20T19:52:30.544090518+01:00\" level=debug\r\nmsg=\"docker-novolume-plugin's manifest: &{[authz]}\"\r\nDec 20 19:52:30 localhost.localdomain docker[25767]:\r\ntime=\"2015-12-20T19:52:30.544170677+01:00\" level=debug\r\nmsg=\"docker-novolume-plugin implements: authz\"\r\n```\r\n\r\nSigned-off-by: Antonio Murdaca <runcom@redhat.com>","created_at":"2015-12-20T19:33:58Z","updated_at":"2015-12-23T23:09:06Z","closed_at":"2015-12-23T23:09:06Z","merged_at":"2015-12-23T23:09:06Z","merge_commit_sha":"254b22f7d95095dacb6b21d4af97914d90b0307d","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/docker/docker/pulls/18810/commits","review_comments_url":"https://api.github.com/repos/docker/docker/pulls/18810/comments","review_comment_url":"https://api.github.com/repos/docker/docker/pulls/comments{/number}","comments_url":"https://api.github.com/repos/docker/docker/issues/18810/comments","statuses_url":"https://api.github.com/repos/docker/docker/statuses/c28fc06e002e06deed3437da76bc213b7bd752ba","head":{"label":"runcom:pkg-authz-fixes","ref":"pkg-authz-fixes","sha":"c28fc06e002e06deed3437da76bc213b7bd752ba","user":{"login":"runcom","id":849915,"avatar_url":"https://avatars.githubusercontent.com/u/849915?v=3","gravatar_id":"","url":"https://api.github.com/users/runcom","html_url":"https://github.com/runcom","followers_url":"https://api.github.com/users/runcom/followers","following_url":"https://api.github.com/users/runcom/following{/other_user}","gists_url":"https://api.github.com/users/runcom/gists{/gist_id}","starred_url":"https://api.github.com/users/runcom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/runcom/subscriptions","organizations_url":"https://api.github.com/users/runcom/orgs","repos_url":"https://api.github.com/users/runcom/repos","events_url":"https://api.github.com/users/runcom/events{/privacy}","received_events_url":"https://api.github.com/users/runcom/received_events","type":"User","site_admin":false},"repo":{"id":32636176,"name":"docker","full_name":"runcom/docker","owner":{"login":"runcom","id":849915,"avatar_url":"https://avatars.githubusercontent.com/u/849915?v=3","gravatar_id":"","url":"https://api.github.com/users/runcom","html_url":"https://github.com/runcom","followers_url":"https://api.github.com/users/runcom/followers","following_url":"https://api.github.com/users/runcom/following{/other_user}","gists_url":"https://api.github.com/users/runcom/gists{/gist_id}","starred_url":"https://api.github.com/users/runcom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/runcom/subscriptions","organizations_url":"https://api.github.com/users/runcom/orgs","repos_url":"https://api.github.com/users/runcom/repos","events_url":"https://api.github.com/users/runcom/events{/privacy}","received_events_url":"https://api.github.com/users/runcom/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/runcom/docker","description":"Docker - the open-source application container engine","fork":true,"url":"https://api.github.com/repos/runcom/docker","forks_url":"https://api.github.com/repos/runcom/docker/forks","keys_url":"https://api.github.com/repos/runcom/docker/keys{/key_id}","collaborators_url":"https://api.github.com/repos/runcom/docker/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/runcom/docker/teams","hooks_url":"https://api.github.com/repos/runcom/docker/hooks","issue_events_url":"https://api.github.com/repos/runcom/docker/issues/events{/number}","events_url":"https://api.github.com/repos/runcom/docker/events","assignees_url":"https://api.github.com/repos/runcom/docker/assignees{/user}","branches_url":"https://api.github.com/repos/runcom/docker/branches{/branch}","tags_url":"https://api.github.com/repos/runcom/docker/tags","blobs_url":"https://api.github.com/repos/runcom/docker/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/runcom/docker/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/runcom/docker/git/refs{/sha}","trees_url":"https://api.github.com/repos/runcom/docker/git/trees{/sha}","statuses_url":"https://api.github.com/repos/runcom/docker/statuses/{sha}","languages_url":"https://api.github.com/repos/runcom/docker/languages","stargazers_url":"https://api.github.com/repos/runcom/docker/stargazers","contributors_url":"https://api.github.com/repos/runcom/docker/contributors","subscribers_url":"https://api.github.com/repos/runcom/docker/subscribers","subscription_url":"https://api.github.com/repos/runcom/docker/subscription","commits_url":"https://api.github.com/repos/runcom/docker/commits{/sha}","git_commits_url":"https://api.github.com/repos/runcom/docker/git/commits{/sha}","comments_url":"https://api.github.com/repos/runcom/docker/comments{/number}","issue_comment_url":"https://api.github.com/repos/runcom/docker/issues/comments{/number}","contents_url":"https://api.github.com/repos/runcom/docker/contents/{+path}","compare_url":"https://api.github.com/repos/runcom/docker/compare/{base}...{head}","merges_url":"https://api.github.com/repos/runcom/docker/merges","archive_url":"https://api.github.com/repos/runcom/docker/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/runcom/docker/downloads","issues_url":"https://api.github.com/repos/runcom/docker/issues{/number}","pulls_url":"https://api.github.com/repos/runcom/docker/pulls{/number}","milestones_url":"https://api.github.com/repos/runcom/docker/milestones{/number}","notifications_url":"https://api.github.com/repos/runcom/docker/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/runcom/docker/labels{/name}","releases_url":"https://api.github.com/repos/runcom/docker/releases{/id}","created_at":"2015-03-21T14:55:26Z","updated_at":"2015-05-07T17:30:16Z","pushed_at":"2015-12-23T20:08:45Z","git_url":"git://github.com/runcom/docker.git","ssh_url":"git@github.com:runcom/docker.git","clone_url":"https://github.com/runcom/docker.git","svn_url":"https://github.com/runcom/docker","homepage":"http://www.docker.com","size":78270,"stargazers_count":1,"watchers_count":1,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"docker:master","ref":"master","sha":"fc87c5a2f1120a70e04d787a340abfa204e3fb13","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":"2015-12-23T21:37:59Z","pushed_at":"2015-12-23T23:09:06Z","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":121626,"stargazers_count":27234,"watchers_count":27234,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":7457,"mirror_url":null,"open_issues_count":1261,"forks":7457,"open_issues":1261,"watchers":27234,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/docker/docker/pulls/18810"},"html":{"href":"https://github.com/docker/docker/pull/18810"},"issue":{"href":"https://api.github.com/repos/docker/docker/issues/18810"},"comments":{"href":"https://api.github.com/repos/docker/docker/issues/18810/comments"},"review_comments":{"href":"https://api.github.com/repos/docker/docker/pulls/18810/comments"},"review_comment":{"href":"https://api.github.com/repos/docker/docker/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/docker/docker/pulls/18810/commits"},"statuses":{"href":"https://api.github.com/repos/docker/docker/statuses/c28fc06e002e06deed3437da76bc213b7bd752ba"}},"merged":true,"mergeable":null,"mergeable_state":"unknown","merged_by":{"login":"icecrime","id":1564054,"avatar_url":"https://avatars.githubusercontent.com/u/1564054?v=3","gravatar_id":"","url":"https://api.github.com/users/icecrime","html_url":"https://github.com/icecrime","followers_url":"https://api.github.com/users/icecrime/followers","following_url":"https://api.github.com/users/icecrime/following{/other_user}","gists_url":"https://api.github.com/users/icecrime/gists{/gist_id}","starred_url":"https://api.github.com/users/icecrime/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/icecrime/subscriptions","organizations_url":"https://api.github.com/users/icecrime/orgs","repos_url":"https://api.github.com/users/icecrime/repos","events_url":"https://api.github.com/users/icecrime/events{/privacy}","received_events_url":"https://api.github.com/users/icecrime/received_events","type":"User","site_admin":false},"comments":9,"review_comments":0,"commits":1,"additions":25,"deletions":7,"changed_files":4}}