{"action":"created","comment":{"url":"https://api.github.com/repos/docker/docker/pulls/comments/104745489","pull_request_review_id":25596007,"id":104745489,"diff_hunk":"@@ -427,9 +427,21 @@ func loadVolumes(source types.Dict) (map[string]types.VolumeConfig, error) {\n \t\treturn volumes, err\n \t}\n \tfor name, volume := range volumes {\n-\t\tif volume.External.External && volume.External.Name == \"\" {\n-\t\t\tvolume.External.Name = name\n-\t\t\tvolumes[name] = volume\n+\t\tif volume.External.External {\n+\t\t\ttemplate := \"both external and %s are specified for volume %q. Only one is allowed.\"","path":"cli/compose/loader/loader.go","position":8,"original_position":8,"commit_id":"8a74f2020c990b40e704f44bebf8c444b799783b","original_commit_id":"8a74f2020c990b40e704f44bebf8c444b799783b","user":{"login":"adshmh","id":23505281,"avatar_url":"https://avatars1.githubusercontent.com/u/23505281?v=3","gravatar_id":"","url":"https://api.github.com/users/adshmh","html_url":"https://github.com/adshmh","followers_url":"https://api.github.com/users/adshmh/followers","following_url":"https://api.github.com/users/adshmh/following{/other_user}","gists_url":"https://api.github.com/users/adshmh/gists{/gist_id}","starred_url":"https://api.github.com/users/adshmh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adshmh/subscriptions","organizations_url":"https://api.github.com/users/adshmh/orgs","repos_url":"https://api.github.com/users/adshmh/repos","events_url":"https://api.github.com/users/adshmh/events{/privacy}","received_events_url":"https://api.github.com/users/adshmh/received_events","type":"User","site_admin":false},"body":"Thank you for the review. Yes, I think this reads a lot better. Will update the PR. ","created_at":"2017-03-07T18:45:01Z","updated_at":"2017-03-07T18:45:01Z","html_url":"https://github.com/docker/docker/pull/31176#discussion_r104745489","pull_request_url":"https://api.github.com/repos/docker/docker/pulls/31176","_links":{"self":{"href":"https://api.github.com/repos/docker/docker/pulls/comments/104745489"},"html":{"href":"https://github.com/docker/docker/pull/31176#discussion_r104745489"},"pull_request":{"href":"https://api.github.com/repos/docker/docker/pulls/31176"}}},"pull_request":{"url":"https://api.github.com/repos/docker/docker/pulls/31176","id":106948602,"html_url":"https://github.com/docker/docker/pull/31176","diff_url":"https://github.com/docker/docker/pull/31176.diff","patch_url":"https://github.com/docker/docker/pull/31176.patch","issue_url":"https://api.github.com/repos/docker/docker/issues/31176","number":31176,"state":"open","locked":false,"title":"stack deploy exits with error if both 'external' and other options are specified for a volume","user":{"login":"adshmh","id":23505281,"avatar_url":"https://avatars1.githubusercontent.com/u/23505281?v=3","gravatar_id":"","url":"https://api.github.com/users/adshmh","html_url":"https://github.com/adshmh","followers_url":"https://api.github.com/users/adshmh/followers","following_url":"https://api.github.com/users/adshmh/following{/other_user}","gists_url":"https://api.github.com/users/adshmh/gists{/gist_id}","starred_url":"https://api.github.com/users/adshmh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adshmh/subscriptions","organizations_url":"https://api.github.com/users/adshmh/orgs","repos_url":"https://api.github.com/users/adshmh/repos","events_url":"https://api.github.com/users/adshmh/events{/privacy}","received_events_url":"https://api.github.com/users/adshmh/received_events","type":"User","site_admin":false},"body":"stack deploy should exit with error if both 'external' and other options are specified for a volume. Fixes #29662.\r\n\r\nSigned-off-by: Arash Deshmeh <adeshmeh@ca.ibm.com>\r\n\r\n\r\n**- What I did**\r\nstack deploy command ignores options specified for a volume when the 'external' option is set to true for that volume. This PR makes it an error to specify both 'external' and other options for a volume.\r\n\r\n**- How I did it**\r\nAdded a check to test whether both 'external' is set and other options are specified for any of the volumes in the yaml compose file.\r\n\r\n**- How to verify it**\r\n1. Use a compose file with the following contents:\r\n```\r\nversion: '3'\r\nvolumes:\r\n  external_volume:\r\n    driver_opts:\r\n      device: =/my-path-on-host\r\n    external: true\r\n```\r\n\r\n\r\n2. run stack deploy. With this PR included:\r\n$ docker stack deploy --compose-file=./compose.yml s1\r\nboth 'external' and options are specified for volume \"external_volume\". Only one is allowed\r\n\r\n\r\n**- Description for the changelog**\r\ndocker stack deploy exits with error if both 'external' is set and other options are specified for a volume.\r\n\r\n**- A picture of a cute animal (not mandatory but encouraged)**\r\n\r\n","created_at":"2017-02-20T06:51:26Z","updated_at":"2017-03-07T18:45:01Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e5a38e84f35c230a6d51d0e95df61ffd77e4ced0","assignee":{"login":"aaronlehmann","id":10601430,"avatar_url":"https://avatars0.githubusercontent.com/u/10601430?v=3","gravatar_id":"","url":"https://api.github.com/users/aaronlehmann","html_url":"https://github.com/aaronlehmann","followers_url":"https://api.github.com/users/aaronlehmann/followers","following_url":"https://api.github.com/users/aaronlehmann/following{/other_user}","gists_url":"https://api.github.com/users/aaronlehmann/gists{/gist_id}","starred_url":"https://api.github.com/users/aaronlehmann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aaronlehmann/subscriptions","organizations_url":"https://api.github.com/users/aaronlehmann/orgs","repos_url":"https://api.github.com/users/aaronlehmann/repos","events_url":"https://api.github.com/users/aaronlehmann/events{/privacy}","received_events_url":"https://api.github.com/users/aaronlehmann/received_events","type":"User","site_admin":false},"assignees":[{"login":"aaronlehmann","id":10601430,"avatar_url":"https://avatars0.githubusercontent.com/u/10601430?v=3","gravatar_id":"","url":"https://api.github.com/users/aaronlehmann","html_url":"https://github.com/aaronlehmann","followers_url":"https://api.github.com/users/aaronlehmann/followers","following_url":"https://api.github.com/users/aaronlehmann/following{/other_user}","gists_url":"https://api.github.com/users/aaronlehmann/gists{/gist_id}","starred_url":"https://api.github.com/users/aaronlehmann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aaronlehmann/subscriptions","organizations_url":"https://api.github.com/users/aaronlehmann/orgs","repos_url":"https://api.github.com/users/aaronlehmann/repos","events_url":"https://api.github.com/users/aaronlehmann/events{/privacy}","received_events_url":"https://api.github.com/users/aaronlehmann/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/docker/docker/pulls/31176/commits","review_comments_url":"https://api.github.com/repos/docker/docker/pulls/31176/comments","review_comment_url":"https://api.github.com/repos/docker/docker/pulls/comments{/number}","comments_url":"https://api.github.com/repos/docker/docker/issues/31176/comments","statuses_url":"https://api.github.com/repos/docker/docker/statuses/8a74f2020c990b40e704f44bebf8c444b799783b","head":{"label":"adshmh:29662-stack-deploy-error-if-external-combined-with-other-volume-options","ref":"29662-stack-deploy-error-if-external-combined-with-other-volume-options","sha":"8a74f2020c990b40e704f44bebf8c444b799783b","user":{"login":"adshmh","id":23505281,"avatar_url":"https://avatars1.githubusercontent.com/u/23505281?v=3","gravatar_id":"","url":"https://api.github.com/users/adshmh","html_url":"https://github.com/adshmh","followers_url":"https://api.github.com/users/adshmh/followers","following_url":"https://api.github.com/users/adshmh/following{/other_user}","gists_url":"https://api.github.com/users/adshmh/gists{/gist_id}","starred_url":"https://api.github.com/users/adshmh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adshmh/subscriptions","organizations_url":"https://api.github.com/users/adshmh/orgs","repos_url":"https://api.github.com/users/adshmh/repos","events_url":"https://api.github.com/users/adshmh/events{/privacy}","received_events_url":"https://api.github.com/users/adshmh/received_events","type":"User","site_admin":false},"repo":{"id":75154627,"name":"docker","full_name":"adshmh/docker","owner":{"login":"adshmh","id":23505281,"avatar_url":"https://avatars1.githubusercontent.com/u/23505281?v=3","gravatar_id":"","url":"https://api.github.com/users/adshmh","html_url":"https://github.com/adshmh","followers_url":"https://api.github.com/users/adshmh/followers","following_url":"https://api.github.com/users/adshmh/following{/other_user}","gists_url":"https://api.github.com/users/adshmh/gists{/gist_id}","starred_url":"https://api.github.com/users/adshmh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adshmh/subscriptions","organizations_url":"https://api.github.com/users/adshmh/orgs","repos_url":"https://api.github.com/users/adshmh/repos","events_url":"https://api.github.com/users/adshmh/events{/privacy}","received_events_url":"https://api.github.com/users/adshmh/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/adshmh/docker","description":"Docker - the open-source application container engine","fork":true,"url":"https://api.github.com/repos/adshmh/docker","forks_url":"https://api.github.com/repos/adshmh/docker/forks","keys_url":"https://api.github.com/repos/adshmh/docker/keys{/key_id}","collaborators_url":"https://api.github.com/repos/adshmh/docker/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/adshmh/docker/teams","hooks_url":"https://api.github.com/repos/adshmh/docker/hooks","issue_events_url":"https://api.github.com/repos/adshmh/docker/issues/events{/number}","events_url":"https://api.github.com/repos/adshmh/docker/events","assignees_url":"https://api.github.com/repos/adshmh/docker/assignees{/user}","branches_url":"https://api.github.com/repos/adshmh/docker/branches{/branch}","tags_url":"https://api.github.com/repos/adshmh/docker/tags","blobs_url":"https://api.github.com/repos/adshmh/docker/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/adshmh/docker/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/adshmh/docker/git/refs{/sha}","trees_url":"https://api.github.com/repos/adshmh/docker/git/trees{/sha}","statuses_url":"https://api.github.com/repos/adshmh/docker/statuses/{sha}","languages_url":"https://api.github.com/repos/adshmh/docker/languages","stargazers_url":"https://api.github.com/repos/adshmh/docker/stargazers","contributors_url":"https://api.github.com/repos/adshmh/docker/contributors","subscribers_url":"https://api.github.com/repos/adshmh/docker/subscribers","subscription_url":"https://api.github.com/repos/adshmh/docker/subscription","commits_url":"https://api.github.com/repos/adshmh/docker/commits{/sha}","git_commits_url":"https://api.github.com/repos/adshmh/docker/git/commits{/sha}","comments_url":"https://api.github.com/repos/adshmh/docker/comments{/number}","issue_comment_url":"https://api.github.com/repos/adshmh/docker/issues/comments{/number}","contents_url":"https://api.github.com/repos/adshmh/docker/contents/{+path}","compare_url":"https://api.github.com/repos/adshmh/docker/compare/{base}...{head}","merges_url":"https://api.github.com/repos/adshmh/docker/merges","archive_url":"https://api.github.com/repos/adshmh/docker/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/adshmh/docker/downloads","issues_url":"https://api.github.com/repos/adshmh/docker/issues{/number}","pulls_url":"https://api.github.com/repos/adshmh/docker/pulls{/number}","milestones_url":"https://api.github.com/repos/adshmh/docker/milestones{/number}","notifications_url":"https://api.github.com/repos/adshmh/docker/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/adshmh/docker/labels{/name}","releases_url":"https://api.github.com/repos/adshmh/docker/releases{/id}","deployments_url":"https://api.github.com/repos/adshmh/docker/deployments","created_at":"2016-11-30T05:29:42Z","updated_at":"2016-11-30T05:30:00Z","pushed_at":"2017-03-06T05:55:55Z","git_url":"git://github.com/adshmh/docker.git","ssh_url":"git@github.com:adshmh/docker.git","clone_url":"https://github.com/adshmh/docker.git","svn_url":"https://github.com/adshmh/docker","homepage":"http://www.docker.com","size":123929,"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":"5fd1aee29a91a597488fd3118dc7d3040bcecbe3","user":{"login":"docker","id":5429470,"avatar_url":"https://avatars2.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://avatars2.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}","deployments_url":"https://api.github.com/repos/docker/docker/deployments","created_at":"2013-01-18T18:10:57Z","updated_at":"2017-03-07T18:28:57Z","pushed_at":"2017-03-07T17:22:49Z","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":"https://www.docker.com","size":125350,"stargazers_count":40368,"watchers_count":40368,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":12143,"mirror_url":null,"open_issues_count":2410,"forks":12143,"open_issues":2410,"watchers":40368,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/docker/docker/pulls/31176"},"html":{"href":"https://github.com/docker/docker/pull/31176"},"issue":{"href":"https://api.github.com/repos/docker/docker/issues/31176"},"comments":{"href":"https://api.github.com/repos/docker/docker/issues/31176/comments"},"review_comments":{"href":"https://api.github.com/repos/docker/docker/pulls/31176/comments"},"review_comment":{"href":"https://api.github.com/repos/docker/docker/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/docker/docker/pulls/31176/commits"},"statuses":{"href":"https://api.github.com/repos/docker/docker/statuses/8a74f2020c990b40e704f44bebf8c444b799783b"}}}}
{"actor":{"display_login":"adshmh"}}