MCPcopy Create free account
hub / github.com/cloudnative-pg/cloudnative-pg / HasLabels

Function HasLabels

tests/utils/pods/pod.go:166–175  ·  view source on GitHub ↗

HasLabels verifies that the labels of a pod contain a specified labels map

(pod corev1.Pod, labels map[string]string)

Source from the content-addressed store, hash-verified

164// HasLabels verifies that the labels of a pod contain a specified
165// labels map
166func HasLabels(pod corev1.Pod, labels map[string]string) bool {
167 podLabels := pod.Labels
168 for k, v := range labels {
169 val, ok := podLabels[k]
170 if !ok || (v != val) {
171 return false
172 }
173 }
174 return true
175}
176
177// HasAnnotations verifies that the annotations of a pod contain a specified
178// annotations map

Callers 1

AllPodsHaveLabelsFunction · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected