MCPcopy
hub / github.com/cilium/cilium / Contains

Method Contains

pkg/labels/array.go:86–99  ·  view source on GitHub ↗

Contains returns true if all ls contains all the labels in needed. If needed contains no labels, Contains() will always return true

(needed LabelArray)

Source from the content-addressed store, hash-verified

84// Contains returns true if all ls contains all the labels in needed. If
85// needed contains no labels, Contains() will always return true
86func (ls LabelArray) Contains(needed LabelArray) bool {
87nextLabel:
88 for i := range needed {
89 for l := range ls {
90 if ls[l].Has(&needed[i]) {
91 continue nextLabel
92 }
93 }
94
95 return false
96 }
97
98 return true
99}
100
101// Intersects returns true if ls contains at least one label in needed.
102//

Callers 15

TestMatchesFunction · 0.95
mainFunction · 0.45
hasJustificationCommentFunction · 0.45
RunMethod · 0.45
checkFunction · 0.45
checkForCategoryFunction · 0.45
checkFileFunction · 0.45
varsToStructFunction · 0.45
grepFileFunction · 0.45
SelectsMethod · 0.45
addMethod · 0.45
addNamespacesToFilterFunction · 0.45

Calls 1

HasMethod · 0.65

Tested by 15

TestMatchesFunction · 0.76
TestAgentEventSubTypeMapFunction · 0.36
TestEventTypesFunction · 0.36
TestConflictsFunction · 0.36
TestTrailingNotFunction · 0.36
Test_UnknownFieldFunction · 0.36
TestAlignCheckerFunction · 0.36
TestHandleK8sDeleteFunction · 0.36
TestSet_StringFunction · 0.36
TestFormStatusResponseFunction · 0.36