Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Parse ¶
Parse takes a string representing a selector and returns a selector object, or an error. This parsing function differs from ParseSelector as they parse different selectors with different syntaxes. The input will cause an error if it does not follow this form:
<selector-syntax> ::= <requirement> | <requirement> "," <selector-syntax>
<requirement> ::= [!] KEY [ <set-based-restriction> | <exact-match-restriction> ]
<set-based-restriction> ::= "" | <inclusion-exclusion> <value-set>
<inclusion-exclusion> ::= <inclusion> | <exclusion>
<exclusion> ::= "notin"
<inclusion> ::= "in"
<value-set> ::= "(" <values> ")"
<values> ::= VALUE | VALUE "," <values>
<exact-match-restriction> ::= ["="|"=="|"!="] VALUE
KEY is a sequence of one or more characters following [ DNS_SUBDOMAIN "/" ] DNS_LABEL. Max length is 63 characters. VALUE is a sequence of zero or more characters "([A-Za-z0-9_-\.])". Max length is 63 characters. Delimiter is white space: (' ', '\t') Example of valid syntax:
"x in (foo,,baz),y,z notin ()"
Note:
- Inclusion - " in " - denotes that the KEY exists and is equal to any of the VALUEs in its requirement
- Exclusion - " notin " - denotes that the KEY is not equal to any of the VALUEs in its requirement or does not exist
- The empty string is a valid VALUE
- A requirement with just a KEY - as in "y" above - denotes that the KEY exists and can be any VALUE.
- A requirement with just !KEY requires that the KEY not exist.
func ParseSelectorOrDie ¶
Parse takes a string representing a selector and returns a selector object, or panic when an error occur. This parsing function differs from ParseSelector as they parse different selectors with different syntaxes. The input will cause an error if it does not follow this form:
<selector-syntax> ::= <requirement> | <requirement> "," <selector-syntax>
<requirement> ::= [!] KEY [ <set-based-restriction> | <exact-match-restriction> ]
<set-based-restriction> ::= "" | <inclusion-exclusion> <value-set>
<inclusion-exclusion> ::= <inclusion> | <exclusion>
<exclusion> ::= "notin"
<inclusion> ::= "in"
<value-set> ::= "(" <values> ")"
<values> ::= VALUE | VALUE "," <values>
<exact-match-restriction> ::= ["="|"=="|"!="] VALUE
KEY is a sequence of one or more characters following [ DNS_SUBDOMAIN "/" ] DNS_LABEL. Max length is 63 characters. VALUE is a sequence of zero or more characters "([A-Za-z0-9_-\.])". Max length is 63 characters. Delimiter is white space: (' ', '\t') Example of valid syntax:
"x in (foo,,baz),y,z notin ()"
Note:
- Inclusion - " in " - denotes that the KEY exists and is equal to any of the VALUEs in its requirement
- Exclusion - " notin " - denotes that the KEY is not equal to any of the VALUEs in its requirement or does not exist
- The empty string is a valid VALUE
- A requirement with just a KEY - as in "y" above - denotes that the KEY exists and can be any VALUE.
- A requirement with just !KEY requires that the KEY not exist.
func ParseToRequirements ¶
func ParseToRequirements(selector string, opts ...field.PathOption) ([]selector.Requirement, error)
ParseToRequirements takes a string representing a selector and returns a list of requirements. This function is suitable for those callers that perform additional processing on selector requirements.
Types ¶
This section is empty.