mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 11:50:44 +00:00
Merge pull request #93860 from habibrosyad/patch-92402-3
fix vendor/k8s.io/apimachinery/pkg/labels staticcheck
This commit is contained in:
commit
b9f25004c3
@ -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/unstructured/unstructuredscheme
|
||||||
vendor/k8s.io/apimachinery/pkg/apis/meta/v1/validation
|
vendor/k8s.io/apimachinery/pkg/apis/meta/v1/validation
|
||||||
vendor/k8s.io/apimachinery/pkg/conversion
|
vendor/k8s.io/apimachinery/pkg/conversion
|
||||||
vendor/k8s.io/apimachinery/pkg/labels
|
|
||||||
vendor/k8s.io/apimachinery/pkg/runtime
|
vendor/k8s.io/apimachinery/pkg/runtime
|
||||||
vendor/k8s.io/apimachinery/pkg/runtime/serializer/json
|
vendor/k8s.io/apimachinery/pkg/runtime/serializer/json
|
||||||
vendor/k8s.io/apimachinery/pkg/runtime/serializer/versioning
|
vendor/k8s.io/apimachinery/pkg/runtime/serializer/versioning
|
||||||
|
@ -789,12 +789,12 @@ func (p *Parser) parseIdentifiersList() (sets.String, error) {
|
|||||||
// parseExactValue parses the only value for exact match style
|
// parseExactValue parses the only value for exact match style
|
||||||
func (p *Parser) parseExactValue() (sets.String, error) {
|
func (p *Parser) parseExactValue() (sets.String, error) {
|
||||||
s := sets.NewString()
|
s := sets.NewString()
|
||||||
tok, lit := p.lookahead(Values)
|
tok, _ := p.lookahead(Values)
|
||||||
if tok == EndOfStringToken || tok == CommaToken {
|
if tok == EndOfStringToken || tok == CommaToken {
|
||||||
s.Insert("")
|
s.Insert("")
|
||||||
return s, nil
|
return s, nil
|
||||||
}
|
}
|
||||||
tok, lit = p.consume(Values)
|
tok, lit := p.consume(Values)
|
||||||
if tok == IdentifierToken {
|
if tok == IdentifierToken {
|
||||||
s.Insert(lit)
|
s.Insert(lit)
|
||||||
return s, nil
|
return s, nil
|
||||||
|
@ -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) {
|
func expectNoMatchDirect(t *testing.T, selector, ls Set) {
|
||||||
if SelectorFromSet(selector).Matches(ls) {
|
if SelectorFromSet(selector).Matches(ls) {
|
||||||
t.Errorf("Wanted '%s' to not match '%s', but it did.", selector, 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}},
|
{"key<1", []Token{IdentifierToken, LessThanToken, IdentifierToken}},
|
||||||
}
|
}
|
||||||
for _, v := range testcases {
|
for _, v := range testcases {
|
||||||
var literals []string
|
|
||||||
var tokens []Token
|
var tokens []Token
|
||||||
l := &Lexer{s: v.s, pos: 0}
|
l := &Lexer{s: v.s, pos: 0}
|
||||||
for {
|
for {
|
||||||
token, lit := l.Lex()
|
token, _ := l.Lex()
|
||||||
if token == EndOfStringToken {
|
if token == EndOfStringToken {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
tokens = append(tokens, token)
|
tokens = append(tokens, token)
|
||||||
literals = append(literals, lit)
|
|
||||||
}
|
}
|
||||||
if len(tokens) != len(v.t) {
|
if len(tokens) != len(v.t) {
|
||||||
t.Errorf("Bad number of tokens for '%s %d, %d", v.s, len(tokens), len(v.t))
|
t.Errorf("Bad number of tokens for '%s %d, %d", v.s, len(tokens), len(v.t))
|
||||||
|
Loading…
Reference in New Issue
Block a user