From f3a13f80b63fddcb0d3532761d276abafa8d6236 Mon Sep 17 00:00:00 2001 From: Chai Bot Date: Mon, 24 Aug 2026 21:31:48 +0000 Subject: [PATCH] Bug 112283: Allow KubeDaemonSetMisScheduled alert on external platform clusters Platform-external clusters experience the same transient DaemonSet mis-scheduling as managed-service clusters: out-of-tree cloud providers taint/label nodes after some platform DaemonSets are initially scheduled, causing KubeDaemonSetMisScheduled to fire briefly until the DaemonSets are rebalanced. Extend the existing managed-service exclusion (OCPBUGS-46079) to also allow this alert on clusters whose infrastructure platform type is External. Introduce a reusable exutil.IsExternalPlatformCluster helper in test/extended/util/framework.go, following the same pattern as IsSelfManagedHA and IsSingleNode, and use it from the Prometheus alerts test instead of an inline Infrastructure lookup. Co-Authored-By: Claude Opus 4.8 --- test/extended/prometheus/prometheus.go | 9 ++++++++- test/extended/util/framework.go | 12 ++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/test/extended/prometheus/prometheus.go b/test/extended/prometheus/prometheus.go index 579a135302bb..7b00fe114347 100644 --- a/test/extended/prometheus/prometheus.go +++ b/test/extended/prometheus/prometheus.go @@ -664,9 +664,16 @@ var _ = g.Describe("[Jira:\"Test Framework\"] Prometheus [apigroup:config.opensh // after some of the platform DS are scheduled there, causing this alert to fire. Managed services // rebalances the DS after the taint is added, and the alert clears, but origin fails this test. Allowing // this alert to fire while we investigate why the taint is not added at node birth. + // + // OCPBUGS-112283: platform-external clusters experience the same transient DaemonSet mis-scheduling. + // Out-of-tree cloud providers taint/label nodes after some platform DaemonSets are initially scheduled, + // causing KubeDaemonSetMisScheduled to fire briefly until the DaemonSets are rebalanced. Allow this + // alert to fire on External platform clusters as well. isManagedService, err := exutil.IsManagedServiceCluster(ctx, oc.AdminKubeClient()) o.Expect(err).NotTo(o.HaveOccurred()) - if isManagedService { + isExternalPlatform, err := exutil.IsExternalPlatformCluster(ctx, oc.AdminConfigClient()) + o.Expect(err).NotTo(o.HaveOccurred()) + if isManagedService || isExternalPlatform { allowedAlertNames.Insert("KubeDaemonSetMisScheduled") } // https://issues.redhat.com/browse/OCPBUGS-48340 diff --git a/test/extended/util/framework.go b/test/extended/util/framework.go index e640dedad0d4..8fe613fcff65 100644 --- a/test/extended/util/framework.go +++ b/test/extended/util/framework.go @@ -2313,6 +2313,18 @@ func IsHypershift(ctx context.Context, configClient clientconfigv1.Interface) (b return infrastructure.Status.ControlPlaneTopology == configv1.ExternalTopologyMode, nil } +// IsExternalPlatformCluster returns true if the cluster's infrastructure platform +// type is External, i.e. the cluster runs on a third-party/out-of-tree cloud +// provider. See OCPBUGS-112283. +func IsExternalPlatformCluster(ctx context.Context, configClient clientconfigv1.Interface) (bool, error) { + infrastructure, err := configClient.ConfigV1().Infrastructures().Get(ctx, "cluster", metav1.GetOptions{}) + if err != nil { + return false, err + } + + return infrastructure.Status.PlatformStatus != nil && infrastructure.Status.PlatformStatus.Type == configv1.ExternalPlatformType, nil +} + // IsMicroShiftCluster returns "true" if a cluster is MicroShift, // "false" otherwise. It needs kube-admin client as input. //