Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions test/extended/prometheus/prometheus.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
//
Expand Down Expand Up @@ -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 {
Expand Down