MCPcopy Index your code
hub / github.com/kubernetes-sigs/controller-runtime / ApplyToList

Method ApplyToList

pkg/client/options.go:609–621  ·  view source on GitHub ↗

ApplyToList applies this configuration to the given list options.

(opts *ListOptions)

Source from the content-addressed store, hash-verified

607
608// ApplyToList applies this configuration to the given list options.
609func (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.
624func (m MatchingLabels) ApplyToDeleteAllOf(opts *DeleteAllOfOptions) {

Callers 1

ApplyToDeleteAllOfMethod · 0.95

Calls 1

AddMethod · 0.65

Tested by

no test coverage detected