Skip to content

Commit

Permalink
Merge pull request #29272 from dgoodwin/restore-rosa-exceptions
Browse files Browse the repository at this point in the history
NO-JIRA: restore rosa exceptions
  • Loading branch information
openshift-merge-bot[bot] authored Nov 9, 2024
2 parents 23ca269 + 60e9e7c commit 6807d0c
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 13 deletions.
15 changes: 10 additions & 5 deletions test/extended/operators/daemon_set.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,15 @@ var _ = g.Describe("[sig-arch] Managed cluster", func() {
controlPlaneTopology, err := exutil.GetControlPlaneTopology(oc)
o.Expect(err).NotTo(o.HaveOccurred())

exceptions := sets.NewString(
// These shouldn't be DaemonSets as they end up being scheduled to all nodes because contrary to selfhosted OCP
// there are no master nodes. Today it is unclear how networking will look like in the future so it isn't worth
// chaning yet. Future work and removal of these exceptions is tracked in https://issues.redhat.com/browse/HOSTEDCP-279
// These shouldn't be DaemonSets as they end up being scheduled to all nodes because contrary to selfhosted OCP
// there are no master nodes. Today it is unclear how networking will look like in the future so it isn't worth
// chaning yet. Future work and removal of these exceptions is tracked in https://issues.redhat.com/browse/HOSTEDCP-279
hyperShiftExceptions := sets.NewString(
"openshift-multus/multus-admission-controller",
"openshift-sdn/sdn-controller",
)

exceptions := sets.NewString(
// Managed service exceptions https://issues.redhat.com/browse/OSD-26323
"openshift-security/splunkforwarder-ds",
"openshift-validation-webhook/validation-webhook",
Expand All @@ -80,7 +82,10 @@ var _ = g.Describe("[sig-arch] Managed cluster", func() {
continue
}
}
if *controlPlaneTopology == configv1.ExternalTopologyMode && exceptions.Has(ds.Namespace+"/"+ds.Name) {
if *controlPlaneTopology == configv1.ExternalTopologyMode && hyperShiftExceptions.Has(ds.Namespace+"/"+ds.Name) {
continue
}
if exceptions.Has(ds.Namespace + "/" + ds.Name) {
continue
}

Expand Down
50 changes: 42 additions & 8 deletions test/extended/operators/resources.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,13 @@ import (
"strings"

g "github.com/onsi/ginkgo/v2"
"github.com/openshift/origin/pkg/test/ginkgo/result"
exutil "github.com/openshift/origin/test/extended/util"
v1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/kube-openapi/pkg/util/sets"
e2e "k8s.io/kubernetes/test/e2e/framework"

"github.com/openshift/origin/pkg/test/ginkgo/result"
exutil "github.com/openshift/origin/test/extended/util"
)

var _ = g.Describe("[sig-arch] Managed cluster", func() {
Expand All @@ -33,9 +34,41 @@ var _ = g.Describe("[sig-arch] Managed cluster", func() {
e2e.Failf("unable to list pods: %v", err)
}

exemptNamespaces := []string{
// Must-gather runs are excluded from this rule
"openshift-must-gather",

// Managed service namespaces - https://issues.redhat.com/browse/OSD-21708
"openshift-addon-operator",
"openshift-backplane",
"openshift-backplane-srep",
"openshift-custom-domains-operator",
"openshift-deployment-validation-operator",
"openshift-managed-node-metadata-operator",
"openshift-managed-upgrade-operator",
"openshift-marketplace",
"openshift-observability-operator",
"openshift-ocm-agent-operator",
"openshift-osd-metrics",
"openshift-package-operator",
"openshift-rbac-permissions",
"openshift-route-monitor-operator",
"openshift-security",
"openshift-splunk-forwarder-operator",
"openshift-sre-pruning",
"openshift-validation-webhook",
}

// pods that have a bug opened, every entry here must have a bug associated
knownBrokenPods := map[string]string{
//"<apiVersion>/<kind>/<namespace>/<name>/(initContainer|container)/<container_name>/<violation_type>": "<url to bug>",

// Managed service pods that have limits but not requests
"apps/v1/Deployment/openshift-monitoring/configure-alertmanager-operator/container/configure-alertmanager-operator/limit[cpu]": "https://issues.redhat.com/browse/OSD-21708",
"apps/v1/Deployment/openshift-monitoring/configure-alertmanager-operator/container/configure-alertmanager-operator/limit[memory]": "https://issues.redhat.com/browse/OSD-21708",

"apps/v1/DaemonSet/openshift-multus/cni-sysctl-allowlist-ds/container/kube-multus-additional-cni-plugins/request[cpu]": "https://issues.redhat.com/browse/TRT-1871",
"apps/v1/DaemonSet/openshift-multus/cni-sysctl-allowlist-ds/container/kube-multus-additional-cni-plugins/request[memory]": "https://issues.redhat.com/browse/TRT-1871",
}

// pods with an exception granted, the value should be the justification and the approver (a release architect)
Expand Down Expand Up @@ -71,14 +104,17 @@ var _ = g.Describe("[sig-arch] Managed cluster", func() {
waitingForFix := sets.NewString()
notAllowed := sets.NewString()
possibleFuture := sets.NewString()
podLoop:
for _, pod := range pods.Items {
// Only pods in the openshift-*, kube-*, and default namespaces are considered
if !strings.HasPrefix(pod.Namespace, "openshift-") && !strings.HasPrefix(pod.Namespace, "kube-") && pod.Namespace != "default" {
continue
}
// Must-gather runs are excluded from this rule
if strings.HasPrefix(pod.Namespace, "openshift-must-gather") {
continue

for _, ns := range exemptNamespaces {
if pod.Namespace == ns {
continue podLoop
}
}
// var controlPlaneTarget bool
// selector := labels.SelectorFromSet(pod.Spec.NodeSelector)
Expand All @@ -104,9 +140,7 @@ var _ = g.Describe("[sig-arch] Managed cluster", func() {
}
}
case "Job":
if pod.Namespace == "openshift-marketplace" {
ref.Name = "<batch_job>"
}
ref.Name = "<batch_job>"
case "Node":
continue
}
Expand Down

0 comments on commit 6807d0c

Please sign in to comment.