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

Function HasAnnotations

tests/utils/pods/pod.go:179–188  ·  view source on GitHub ↗

HasAnnotations verifies that the annotations of a pod contain a specified annotations map

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

Source from the content-addressed store, hash-verified

177// HasAnnotations verifies that the annotations of a pod contain a specified
178// annotations map
179func HasAnnotations(pod corev1.Pod, annotations map[string]string) bool {
180 podAnnotations := pod.Annotations
181 for k, v := range annotations {
182 val, ok := podAnnotations[k]
183 if !ok || (v != val) {
184 return false
185 }
186 }
187 return true
188}
189
190// HasCondition verifies that a pod has a specified condition
191func HasCondition(pod *corev1.Pod, conditionType corev1.PodConditionType, status corev1.ConditionStatus) bool {

Callers 1

AllPodsHaveAnnotationsFunction · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected