mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-07 19:23:40 +00:00
Add getters for labels.Requirement
Useful for some label backends that need access to the fields.
This commit is contained in:
parent
8f9feb40b9
commit
b9ff3a0741
@ -146,6 +146,20 @@ func (r *Requirement) Matches(ls Labels) bool {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (r *Requirement) Key() string {
|
||||||
|
return r.key
|
||||||
|
}
|
||||||
|
func (r *Requirement) Operator() Operator {
|
||||||
|
return r.operator
|
||||||
|
}
|
||||||
|
func (r *Requirement) Values() sets.String {
|
||||||
|
ret := sets.String{}
|
||||||
|
for k := range r.strValues {
|
||||||
|
ret.Insert(k)
|
||||||
|
}
|
||||||
|
return ret
|
||||||
|
}
|
||||||
|
|
||||||
// Return true if the LabelSelector doesn't restrict selection space
|
// Return true if the LabelSelector doesn't restrict selection space
|
||||||
func (lsel LabelSelector) Empty() bool {
|
func (lsel LabelSelector) Empty() bool {
|
||||||
if lsel == nil {
|
if lsel == nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user