fix label selector parser in case no value (or only whitespaces) is specified after the key

This commit is contained in:
Chao Xu
2015-10-02 15:06:58 -07:00
parent 1d73382b83
commit 9be421c053
2 changed files with 11 additions and 2 deletions

View File

@@ -600,7 +600,12 @@ func (p *Parser) parseIdentifiersList() (sets.String, error) {
// parseExactValue parses the only value for exact match style
func (p *Parser) parseExactValue() (sets.String, error) {
s := sets.NewString()
tok, lit := p.consume(Values)
tok, lit := p.lookahead(Values)
if tok == EndOfStringToken || tok == CommaToken {
s.Insert("")
return s, nil
}
tok, lit = p.consume(Values)
if tok == IdentifierToken {
s.Insert(lit)
return s, nil