HasAnnotations verifies that the annotations of a pod contain a specified annotations map
(pod corev1.Pod, annotations map[string]string)
| 177 | // HasAnnotations verifies that the annotations of a pod contain a specified |
| 178 | // annotations map |
| 179 | func 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 |
| 191 | func HasCondition(pod *corev1.Pod, conditionType corev1.PodConditionType, status corev1.ConditionStatus) bool { |
no outgoing calls
no test coverage detected