From c68ea3984d6463c7bae70719ad69e1fc2b78ae67 Mon Sep 17 00:00:00 2001 From: Jan Fajerski Date: Fri, 3 Jul 2026 14:28:21 +0000 Subject: [PATCH] alerting: allow KubeCPUOvercommit on compact clusters On compact 3-node clusters where control-plane nodes also serve as workers, CPU overcommit is expected during e2e test workloads. Add KubeCPUOvercommit to the allowed alert names in the [Early] firing alerts test when running on a compact cluster (no dedicated worker nodes). Fixes https://issues.redhat.com/browse/OCPBUGS-96581 Co-Authored-By: Claude Opus 4.6 Signed-off-by: Jan Fajerski --- test/extended/prometheus/prometheus.go | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/test/extended/prometheus/prometheus.go b/test/extended/prometheus/prometheus.go index 19a6ba5b8837..f0f7f821620f 100644 --- a/test/extended/prometheus/prometheus.go +++ b/test/extended/prometheus/prometheus.go @@ -874,6 +874,11 @@ var _ = g.Describe("[sig-instrumentation] Prometheus [apigroup:image.openshift.i allowedAlertNames = append(allowedAlertNames, "OperatorHubSourceError") } + // https://issues.redhat.com/browse/OCPBUGS-96581 + if isCompactCluster(ctx, oc) { + allowedAlertNames = append(allowedAlertNames, "KubeCPUOvercommit") + } + tests := map[string]bool{ // openshift-e2e-loki alerts should never fail this test, we've seen this happen on daemon set rollout stuck when CI loki was down. // @@ -1189,6 +1194,19 @@ func hasTelemeterClient(client clientset.Interface) bool { return true } +// isCompactCluster returns true when the cluster has a highly-available +// control plane but no dedicated worker nodes (infrastructureTopology is +// SingleReplica). +func isCompactCluster(ctx context.Context, oc *exutil.CLI) bool { + infra, err := oc.AdminConfigClient().ConfigV1().Infrastructures().Get(ctx, "cluster", metav1.GetOptions{}) + if err != nil { + e2e.Logf("could not retrieve infrastructure resource: %v", err) + return false + } + return infra.Status.ControlPlaneTopology == configv1.HighlyAvailableTopologyMode && + infra.Status.InfrastructureTopology == configv1.SingleReplicaTopologyMode +} + func SkipOperatorHubMetricsCheck(oc *exutil.CLI) bool { stdout, stderr, err := oc.AsAdmin().Run("get").Args("operatorhub", "cluster", "-o=jsonpath={.spec.disableAllDefaultSources}").Outputs() if err != nil {