Add getters for labels.Requirement

Useful for some label backends that need access to the fields.
This commit is contained in:
tummychow 2015-10-05 11:48:20 -07:00
parent 8f9feb40b9
commit b9ff3a0741

View File

@ -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
func (lsel LabelSelector) Empty() bool {
if lsel == nil {