Commit b9ff3a07 authored by tummychow's avatar tummychow

Add getters for labels.Requirement

Useful for some label backends that need access to the fields.
parent 8f9feb40
......@@ -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 {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment