Skip to content

Commit 0bb7edf

Browse files
Merge pull request #30815 from ehearne-redhat/fix-debug-pod-exception
CNTRLPLANE-2202: Check for debug pod (regardless of ns) in default service account monitor test
2 parents 565aa49 + 0e37c91 commit 0bb7edf

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

  • pkg/monitortests/authentication/nodefaultserviceaccountoperatortests

pkg/monitortests/authentication/nodefaultserviceaccountoperatortests/monitortest.go

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ var exceptions = []func(pod corev1.Pod) (string, bool){
8080
exceptionWithJira("openshift-cnv/kubevirt-apiserver-proxy-", "https://issues.redhat.com/browse/OCPBUGS-70353"),
8181
exceptionWithJira("openshift-cnv/kubevirt-console-plugin-", "https://issues.redhat.com/browse/OCPBUGS-70353"),
8282
exceptionWithJira("kube-system/global-pull-secret-syncer-", "https://issues.redhat.com/browse/OCPBUGS-70354"),
83+
exceptionWithJira("openshift-nmstate/nmstate-console-plugin-", "https://issues.redhat.com/browse/OCPBUGS-77474"),
8384

8485
// Handle the outlier (Namespace only check) manually
8586
func(pod corev1.Pod) (string, bool) {
@@ -88,10 +89,15 @@ var exceptions = []func(pod corev1.Pod) (string, bool){
8889
}
8990
return "", false
9091
},
91-
// Handle the outlier (Namespace only check) manually
92-
// This one might be simplified to check if it is a debug pod or not.
92+
// Handle the outlier manually
93+
// This one checks if it is a debug pod or not.
9394
func(pod corev1.Pod) (string, bool) {
94-
if pod.Namespace == "openshift-commatrix-test" && strings.Contains(pod.Name, "debug") {
95+
for annotation := range pod.Annotations {
96+
if strings.Contains(annotation, "debug.openshift.io") {
97+
return "https://issues.redhat.com/browse/OCPBUGS-77201", true
98+
}
99+
}
100+
if managedBy, ok := pod.Labels["debug.openshift.io/managed-by"]; ok && managedBy == "oc-debug" {
95101
return "https://issues.redhat.com/browse/OCPBUGS-77201", true
96102
}
97103
return "", false

0 commit comments

Comments
 (0)