filters: handle presence syntax correctly

Signed-off-by: Stephen J Day <stephen.day@docker.com>
This commit is contained in:
Stephen J Day 2017-06-27 15:19:48 -07:00
parent bd25543f5a
commit 1921173569
2 changed files with 10 additions and 1 deletions

View File

@ -112,6 +112,15 @@ func TestFilters(t *testing.T) {
corpus[8],
},
},
{
name: "NameAndLabelPresent",
input: "labels.foo,name",
expected: []interface{}{
corpus[0],
corpus[2],
corpus[8],
},
},
{
name: "LabelValue",
input: "labels.foo==true",

View File

@ -99,7 +99,7 @@ func (p *parser) selector() (selector, error) {
}
switch p.scanner.peek() {
case tokenSeparator, tokenEOF:
case ',', tokenSeparator, tokenEOF:
return selector{
fieldpath: fieldpath,
operator: operatorPresent,