diff --git a/test/framework/clusterctl/clusterctl_helpers.go b/test/framework/clusterctl/clusterctl_helpers.go index 508b657cd7f8..abe1b82b3cb2 100644 --- a/test/framework/clusterctl/clusterctl_helpers.go +++ b/test/framework/clusterctl/clusterctl_helpers.go @@ -191,7 +191,14 @@ func UpgradeManagementClusterAndWait(ctx context.Context, input UpgradeManagemen client := input.ClusterProxy.GetClient() log.Logf("Waiting for provider controllers to be running") - controllersDeployments := framework.GetControllerDeployments(ctx, framework.GetControllerDeploymentsInput{Lister: client}) + controllersDeployments := framework.GetControllerDeployments(ctx, framework.GetControllerDeploymentsInput{ + Lister: client, + // This namespace has been dropped in v0.4.x. + // We have to exclude this namespace here as after an upgrade from v0.3x there won't + // be a controller in this namespace anymore and if we wait for it to come up the test would fail. + // Note: We can drop this as soon as we don't have a test upgrading from v0.3.x anymore. + ExcludeNamespaces: []string{"capi-webhook-system"}, + }) Expect(controllersDeployments).ToNot(BeEmpty(), "The list of controller deployments should not be empty") for _, deployment := range controllersDeployments { framework.WaitForDeploymentsAvailable(ctx, framework.WaitForDeploymentsAvailableInput{