Skip to content
Merged
Show file tree
Hide file tree
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
9 changes: 8 additions & 1 deletion test/extended/prometheus/prometheus.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 12 additions & 0 deletions test/extended/util/framework.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
//
Expand Down