@@ -7,12 +7,13 @@ import (
77 "strings"
88
99 g "github.com/onsi/ginkgo/v2"
10- "github.com/openshift/origin/pkg/test/ginkgo/result"
11- exutil "github.com/openshift/origin/test/extended/util"
1210 v1 "k8s.io/api/core/v1"
1311 metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
1412 "k8s.io/kube-openapi/pkg/util/sets"
1513 e2e "k8s.io/kubernetes/test/e2e/framework"
14+
15+ "github.com/openshift/origin/pkg/test/ginkgo/result"
16+ exutil "github.com/openshift/origin/test/extended/util"
1617)
1718
1819var _ = g .Describe ("[sig-arch] Managed cluster" , func () {
@@ -33,9 +34,38 @@ var _ = g.Describe("[sig-arch] Managed cluster", func() {
3334 e2e .Failf ("unable to list pods: %v" , err )
3435 }
3536
37+ exemptNamespaces := []string {
38+ // Must-gather runs are excluded from this rule
39+ "openshift-must-gather" ,
40+
41+ // Managed service namespaces - https://issues.redhat.com/browse/OSD-21708
42+ "openshift-addon-operator" ,
43+ "openshift-backplane" ,
44+ "openshift-backplane-srep" ,
45+ "openshift-custom-domains-operator" ,
46+ "openshift-deployment-validation-operator" ,
47+ "openshift-managed-node-metadata-operator" ,
48+ "openshift-managed-upgrade-operator" ,
49+ "openshift-marketplace" ,
50+ "openshift-observability-operator" ,
51+ "openshift-ocm-agent-operator" ,
52+ "openshift-osd-metrics" ,
53+ "openshift-package-operator" ,
54+ "openshift-rbac-permissions" ,
55+ "openshift-route-monitor-operator" ,
56+ "openshift-security" ,
57+ "openshift-splunk-forwarder-operator" ,
58+ "openshift-sre-pruning" ,
59+ "openshift-validation-webhook" ,
60+ }
61+
3662 // pods that have a bug opened, every entry here must have a bug associated
3763 knownBrokenPods := map [string ]string {
3864 //"<apiVersion>/<kind>/<namespace>/<name>/(initContainer|container)/<container_name>/<violation_type>": "<url to bug>",
65+
66+ // Managed service pods that have limits but not requests
67+ "apps/v1/Deployment/openshift-monitoring/configure-alertmanager-operator/container/configure-alertmanager-operator/limit[cpu]" : "https://issues.redhat.com/browse/OSD-21708" ,
68+ "apps/v1/Deployment/openshift-monitoring/configure-alertmanager-operator/container/configure-alertmanager-operator/limit[memory]" : "https://issues.redhat.com/browse/OSD-21708" ,
3969 }
4070
4171 // pods with an exception granted, the value should be the justification and the approver (a release architect)
@@ -71,14 +101,17 @@ var _ = g.Describe("[sig-arch] Managed cluster", func() {
71101 waitingForFix := sets .NewString ()
72102 notAllowed := sets .NewString ()
73103 possibleFuture := sets .NewString ()
104+ podLoop:
74105 for _ , pod := range pods .Items {
75106 // Only pods in the openshift-*, kube-*, and default namespaces are considered
76107 if ! strings .HasPrefix (pod .Namespace , "openshift-" ) && ! strings .HasPrefix (pod .Namespace , "kube-" ) && pod .Namespace != "default" {
77108 continue
78109 }
79- // Must-gather runs are excluded from this rule
80- if strings .HasPrefix (pod .Namespace , "openshift-must-gather" ) {
81- continue
110+
111+ for _ , ns := range exemptNamespaces {
112+ if pod .Namespace == ns {
113+ continue podLoop
114+ }
82115 }
83116 // var controlPlaneTarget bool
84117 // selector := labels.SelectorFromSet(pod.Spec.NodeSelector)
@@ -104,9 +137,7 @@ var _ = g.Describe("[sig-arch] Managed cluster", func() {
104137 }
105138 }
106139 case "Job" :
107- if pod .Namespace == "openshift-marketplace" {
108- ref .Name = "<batch_job>"
109- }
140+ ref .Name = "<batch_job>"
110141 case "Node" :
111142 continue
112143 }
0 commit comments