{"action":"created","comment":{"url":"https://api.github.com/repos/docker/docker/pulls/comments/48799907","id":48799907,"diff_hunk":"@@ -393,15 +397,24 @@ func (daemon *Daemon) transformContainer(container *container.Container, ctx *li\n // Volumes lists known volumes, using the filter to restrict the range\n // of volumes returned.\n func (daemon *Daemon) Volumes(filter string) ([]*types.Volume, error) {\n-\tvar volumesOut []*types.Volume\n+\tvar (\n+\t\tvolumesOut []*types.Volume\n+\t\tfilterUsed = false\n+\t)\n \tvolFilters, err := filters.FromParam(filter)\n \tif err != nil {\n \t\treturn nil, err\n \t}\n-\n-\tfilterUsed := volFilters.Include(\"dangling\") &&\n-\t\t(volFilters.ExactMatch(\"dangling\", \"true\") || volFilters.ExactMatch(\"dangling\", \"1\"))\n-\n+\tif err := volFilters.Validate(acceptedVolumeFilterTags); err != nil {\n+\t\treturn nil, err\n+\t}\n+\tif volFilters.Include(\"dangling\") {\n+\t\tif volFilters.ExactMatch(\"dangling\", \"true\") {","path":"daemon/list.go","position":32,"original_position":32,"commit_id":"d6fce9f5af26d5af07cf9838f41eebbb9216c9eb","original_commit_id":"d6fce9f5af26d5af07cf9838f41eebbb9216c9eb","user":{"login":"HackToday","id":10363809,"avatar_url":"https://avatars.githubusercontent.com/u/10363809?v=3","gravatar_id":"","url":"https://api.github.com/users/HackToday","html_url":"https://github.com/HackToday","followers_url":"https://api.github.com/users/HackToday/followers","following_url":"https://api.github.com/users/HackToday/following{/other_user}","gists_url":"https://api.github.com/users/HackToday/gists{/gist_id}","starred_url":"https://api.github.com/users/HackToday/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HackToday/subscriptions","organizations_url":"https://api.github.com/users/HackToday/orgs","repos_url":"https://api.github.com/users/HackToday/repos","events_url":"https://api.github.com/users/HackToday/events{/privacy}","received_events_url":"https://api.github.com/users/HackToday/received_events","type":"User","site_admin":false},"body":"Hi @cpuguy83 if we checked docker images filter with dangling, it not allowed 1, only allow true.\r\n$ docker images -f dangling=1\r\nError response from daemon: Invalid filter 'dangling=1'\r\n\r\nSo I think it is better to keep consistent, whether change image part, or not used \"1\" in volume ","created_at":"2016-01-05T00:20:52Z","updated_at":"2016-01-05T00:20:52Z","html_url":"https://github.com/docker/docker/pull/19044#discussion_r48799907","pull_request_url":"https://api.github.com/repos/docker/docker/pulls/19044","_links":{"self":{"href":"https://api.github.com/repos/docker/docker/pulls/comments/48799907"},"html":{"href":"https://github.com/docker/docker/pull/19044#discussion_r48799907"},"pull_request":{"href":"https://api.github.com/repos/docker/docker/pulls/19044"}}},"pull_request":{"url":"https://api.github.com/repos/docker/docker/pulls/19044","id":54953276,"html_url":"https://github.com/docker/docker/pull/19044","diff_url":"https://github.com/docker/docker/pull/19044.diff","patch_url":"https://github.com/docker/docker/pull/19044.patch","issue_url":"https://api.github.com/repos/docker/docker/issues/19044","number":19044,"state":"open","locked":false,"title":"Fix volume filter validation","user":{"login":"HackToday","id":10363809,"avatar_url":"https://avatars.githubusercontent.com/u/10363809?v=3","gravatar_id":"","url":"https://api.github.com/users/HackToday","html_url":"https://github.com/HackToday","followers_url":"https://api.github.com/users/HackToday/followers","following_url":"https://api.github.com/users/HackToday/following{/other_user}","gists_url":"https://api.github.com/users/HackToday/gists{/gist_id}","starred_url":"https://api.github.com/users/HackToday/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HackToday/subscriptions","organizations_url":"https://api.github.com/users/HackToday/orgs","repos_url":"https://api.github.com/users/HackToday/repos","events_url":"https://api.github.com/users/HackToday/events{/privacy}","received_events_url":"https://api.github.com/users/HackToday/received_events","type":"User","site_admin":false},"body":"Fixes: #18890\r\nThis fix add same filter validation logic as images. We should\r\nadd such check to make sure filters work make sense to end-users\r\n\r\nSigned-off-by: Kai Qiang Wu(Kennan) <wkqwu@cn.ibm.com>","created_at":"2016-01-04T08:45:08Z","updated_at":"2016-01-05T00:20:52Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ae97781b3071039e98b0c88a17dd1f2d204447d8","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/docker/docker/pulls/19044/commits","review_comments_url":"https://api.github.com/repos/docker/docker/pulls/19044/comments","review_comment_url":"https://api.github.com/repos/docker/docker/pulls/comments{/number}","comments_url":"https://api.github.com/repos/docker/docker/issues/19044/comments","statuses_url":"https://api.github.com/repos/docker/docker/statuses/d6fce9f5af26d5af07cf9838f41eebbb9216c9eb","head":{"label":"HackToday:18890-validate-volume","ref":"18890-validate-volume","sha":"d6fce9f5af26d5af07cf9838f41eebbb9216c9eb","user":{"login":"HackToday","id":10363809,"avatar_url":"https://avatars.githubusercontent.com/u/10363809?v=3","gravatar_id":"","url":"https://api.github.com/users/HackToday","html_url":"https://github.com/HackToday","followers_url":"https://api.github.com/users/HackToday/followers","following_url":"https://api.github.com/users/HackToday/following{/other_user}","gists_url":"https://api.github.com/users/HackToday/gists{/gist_id}","starred_url":"https://api.github.com/users/HackToday/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HackToday/subscriptions","organizations_url":"https://api.github.com/users/HackToday/orgs","repos_url":"https://api.github.com/users/HackToday/repos","events_url":"https://api.github.com/users/HackToday/events{/privacy}","received_events_url":"https://api.github.com/users/HackToday/received_events","type":"User","site_admin":false},"repo":{"id":43415718,"name":"docker","full_name":"HackToday/docker","owner":{"login":"HackToday","id":10363809,"avatar_url":"https://avatars.githubusercontent.com/u/10363809?v=3","gravatar_id":"","url":"https://api.github.com/users/HackToday","html_url":"https://github.com/HackToday","followers_url":"https://api.github.com/users/HackToday/followers","following_url":"https://api.github.com/users/HackToday/following{/other_user}","gists_url":"https://api.github.com/users/HackToday/gists{/gist_id}","starred_url":"https://api.github.com/users/HackToday/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HackToday/subscriptions","organizations_url":"https://api.github.com/users/HackToday/orgs","repos_url":"https://api.github.com/users/HackToday/repos","events_url":"https://api.github.com/users/HackToday/events{/privacy}","received_events_url":"https://api.github.com/users/HackToday/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/HackToday/docker","description":"Docker - the open-source application container engine","fork":true,"url":"https://api.github.com/repos/HackToday/docker","forks_url":"https://api.github.com/repos/HackToday/docker/forks","keys_url":"https://api.github.com/repos/HackToday/docker/keys{/key_id}","collaborators_url":"https://api.github.com/repos/HackToday/docker/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/HackToday/docker/teams","hooks_url":"https://api.github.com/repos/HackToday/docker/hooks","issue_events_url":"https://api.github.com/repos/HackToday/docker/issues/events{/number}","events_url":"https://api.github.com/repos/HackToday/docker/events","assignees_url":"https://api.github.com/repos/HackToday/docker/assignees{/user}","branches_url":"https://api.github.com/repos/HackToday/docker/branches{/branch}","tags_url":"https://api.github.com/repos/HackToday/docker/tags","blobs_url":"https://api.github.com/repos/HackToday/docker/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/HackToday/docker/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/HackToday/docker/git/refs{/sha}","trees_url":"https://api.github.com/repos/HackToday/docker/git/trees{/sha}","statuses_url":"https://api.github.com/repos/HackToday/docker/statuses/{sha}","languages_url":"https://api.github.com/repos/HackToday/docker/languages","stargazers_url":"https://api.github.com/repos/HackToday/docker/stargazers","contributors_url":"https://api.github.com/repos/HackToday/docker/contributors","subscribers_url":"https://api.github.com/repos/HackToday/docker/subscribers","subscription_url":"https://api.github.com/repos/HackToday/docker/subscription","commits_url":"https://api.github.com/repos/HackToday/docker/commits{/sha}","git_commits_url":"https://api.github.com/repos/HackToday/docker/git/commits{/sha}","comments_url":"https://api.github.com/repos/HackToday/docker/comments{/number}","issue_comment_url":"https://api.github.com/repos/HackToday/docker/issues/comments{/number}","contents_url":"https://api.github.com/repos/HackToday/docker/contents/{+path}","compare_url":"https://api.github.com/repos/HackToday/docker/compare/{base}...{head}","merges_url":"https://api.github.com/repos/HackToday/docker/merges","archive_url":"https://api.github.com/repos/HackToday/docker/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/HackToday/docker/downloads","issues_url":"https://api.github.com/repos/HackToday/docker/issues{/number}","pulls_url":"https://api.github.com/repos/HackToday/docker/pulls{/number}","milestones_url":"https://api.github.com/repos/HackToday/docker/milestones{/number}","notifications_url":"https://api.github.com/repos/HackToday/docker/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/HackToday/docker/labels{/name}","releases_url":"https://api.github.com/repos/HackToday/docker/releases{/id}","created_at":"2015-09-30T06:22:17Z","updated_at":"2015-09-30T06:22:30Z","pushed_at":"2016-01-04T08:49:46Z","git_url":"git://github.com/HackToday/docker.git","ssh_url":"git@github.com:HackToday/docker.git","clone_url":"https://github.com/HackToday/docker.git","svn_url":"https://github.com/HackToday/docker","homepage":"http://www.docker.com","size":78625,"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":"db738dd77f699e93f976441d5fc11ab48a2d6c68","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-05T00:04:16Z","pushed_at":"2016-01-05T00:12:11Z","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":121043,"stargazers_count":27497,"watchers_count":27497,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":7553,"mirror_url":null,"open_issues_count":1265,"forks":7553,"open_issues":1265,"watchers":27497,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/docker/docker/pulls/19044"},"html":{"href":"https://github.com/docker/docker/pull/19044"},"issue":{"href":"https://api.github.com/repos/docker/docker/issues/19044"},"comments":{"href":"https://api.github.com/repos/docker/docker/issues/19044/comments"},"review_comments":{"href":"https://api.github.com/repos/docker/docker/pulls/19044/comments"},"review_comment":{"href":"https://api.github.com/repos/docker/docker/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/docker/docker/pulls/19044/commits"},"statuses":{"href":"https://api.github.com/repos/docker/docker/statuses/d6fce9f5af26d5af07cf9838f41eebbb9216c9eb"}}}}