ApplyToList applies this configuration to the given list options.
(opts *ListOptions)
| 607 | |
| 608 | // ApplyToList applies this configuration to the given list options. |
| 609 | func (m MatchingLabels) ApplyToList(opts *ListOptions) { |
| 610 | // TODO(directxman12): can we avoid reserializing this over and over? |
| 611 | if opts.LabelSelector == nil { |
| 612 | opts.LabelSelector = labels.SelectorFromValidatedSet(map[string]string(m)) |
| 613 | return |
| 614 | } |
| 615 | // If there's already a selector, we need to AND the two together. |
| 616 | noValidSel := labels.SelectorFromValidatedSet(map[string]string(m)) |
| 617 | reqs, _ := noValidSel.Requirements() |
| 618 | for _, req := range reqs { |
| 619 | opts.LabelSelector = opts.LabelSelector.Add(req) |
| 620 | } |
| 621 | } |
| 622 | |
| 623 | // ApplyToDeleteAllOf applies this configuration to the given an List options. |
| 624 | func (m MatchingLabels) ApplyToDeleteAllOf(opts *DeleteAllOfOptions) { |