Merge pull request #93860 from habibrosyad/patch-92402-3

fix vendor/k8s.io/apimachinery/pkg/labels staticcheck
This commit is contained in:
Kubernetes Prow Robot 2020-08-27 04:47:03 -07:00 committed by GitHub
commit b9f25004c3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 6 deletions

View File

@ -19,7 +19,6 @@ vendor/k8s.io/apimachinery/pkg/apis/meta/v1/unstructured
vendor/k8s.io/apimachinery/pkg/apis/meta/v1/unstructured/unstructuredscheme
vendor/k8s.io/apimachinery/pkg/apis/meta/v1/validation
vendor/k8s.io/apimachinery/pkg/conversion
vendor/k8s.io/apimachinery/pkg/labels
vendor/k8s.io/apimachinery/pkg/runtime
vendor/k8s.io/apimachinery/pkg/runtime/serializer/json
vendor/k8s.io/apimachinery/pkg/runtime/serializer/versioning

View File

@ -789,12 +789,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.lookahead(Values)
tok, _ := p.lookahead(Values)
if tok == EndOfStringToken || tok == CommaToken {
s.Insert("")
return s, nil
}
tok, lit = p.consume(Values)
tok, lit := p.consume(Values)
if tok == IdentifierToken {
s.Insert(lit)
return s, nil

View File

@ -141,6 +141,7 @@ func expectMatchDirect(t *testing.T, selector, ls Set) {
}
}
//lint:ignore U1000 currently commented out in TODO of TestSetMatches
func expectNoMatchDirect(t *testing.T, selector, ls Set) {
if SelectorFromSet(selector).Matches(ls) {
t.Errorf("Wanted '%s' to not match '%s', but it did.", selector, ls)
@ -241,16 +242,14 @@ func TestLexerSequence(t *testing.T) {
{"key<1", []Token{IdentifierToken, LessThanToken, IdentifierToken}},
}
for _, v := range testcases {
var literals []string
var tokens []Token
l := &Lexer{s: v.s, pos: 0}
for {
token, lit := l.Lex()
token, _ := l.Lex()
if token == EndOfStringToken {
break
}
tokens = append(tokens, token)
literals = append(literals, lit)
}
if len(tokens) != len(v.t) {
t.Errorf("Bad number of tokens for '%s %d, %d", v.s, len(tokens), len(v.t))