mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-22 11:21:47 +00:00
Update selector.go
This commit is contained in:
parent
98bc258bf5
commit
d3f4046e62
@ -318,7 +318,7 @@ func (r *Requirement) String() string {
|
||||
return buffer.String()
|
||||
}
|
||||
|
||||
// safeSort sort input strings without modification
|
||||
// safeSort sorts input strings without modification
|
||||
func safeSort(in []string) []string {
|
||||
if sort.StringsAreSorted(in) {
|
||||
return in
|
||||
@ -366,7 +366,7 @@ func (s internalSelector) String() string {
|
||||
return strings.Join(reqs, ",")
|
||||
}
|
||||
|
||||
// RequiresExactMatch introspect whether a given selector requires a single specific field
|
||||
// RequiresExactMatch introspects whether a given selector requires a single specific field
|
||||
// to be set, and if so returns the value it requires.
|
||||
func (s internalSelector) RequiresExactMatch(label string) (value string, found bool) {
|
||||
for ix := range s {
|
||||
@ -444,7 +444,7 @@ func isWhitespace(ch byte) bool {
|
||||
return ch == ' ' || ch == '\t' || ch == '\r' || ch == '\n'
|
||||
}
|
||||
|
||||
// isSpecialSymbol detect if the character ch can be an operator
|
||||
// isSpecialSymbol detects if the character ch can be an operator
|
||||
func isSpecialSymbol(ch byte) bool {
|
||||
switch ch {
|
||||
case '=', '!', '(', ')', ',', '>', '<':
|
||||
@ -462,7 +462,7 @@ type Lexer struct {
|
||||
pos int
|
||||
}
|
||||
|
||||
// read return the character currently lexed
|
||||
// read returns the character currently lexed
|
||||
// increment the position and check the buffer overflow
|
||||
func (l *Lexer) read() (b byte) {
|
||||
b = 0
|
||||
@ -698,7 +698,7 @@ func (p *Parser) parseKeyAndInferOperator() (string, selection.Operator, error)
|
||||
return literal, operator, nil
|
||||
}
|
||||
|
||||
// parseOperator return operator and eventually matchType
|
||||
// parseOperator returns operator and eventually matchType
|
||||
// matchType can be exact
|
||||
func (p *Parser) parseOperator() (op selection.Operator, err error) {
|
||||
tok, lit := p.consume(KeyAndOperator)
|
||||
|
Loading…
Reference in New Issue
Block a user