Skip to content

Commit c97ea3c

Browse files
committed
fix: only verify config map only when worker machine count > 0
1 parent d066e8b commit c97ea3c

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

test/e2e/suites/managed/cluster.go

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,10 +101,13 @@ func ManagedClusterSpec(ctx context.Context, inputGetter func() ManagedClusterSp
101101
verifySecretExists(ctx, fmt.Sprintf("%s-kubeconfig", input.ClusterName), input.Namespace.Name, bootstrapClient)
102102
verifySecretExists(ctx, fmt.Sprintf("%s-user-kubeconfig", input.ClusterName), input.Namespace.Name, bootstrapClient)
103103

104-
ginkgo.By("Checking that aws-iam-authenticator config map exists")
105-
workloadClusterProxy := input.BootstrapClusterProxy.GetWorkloadCluster(ctx, input.Namespace.Name, input.ClusterName)
106-
workloadClient := workloadClusterProxy.GetClient()
107-
verifyConfigMapExists(ctx, "aws-auth", metav1.NamespaceSystem, workloadClient)
104+
// this will not be created unless there are worker machines or set by IAMAuthenticatorConfig on the managed control plane spec
105+
if input.WorkerMachineCount > 0 {
106+
ginkgo.By("Checking that aws-iam-authenticator config map exists")
107+
workloadClusterProxy := input.BootstrapClusterProxy.GetWorkloadCluster(ctx, input.Namespace.Name, input.ClusterName)
108+
workloadClient := workloadClusterProxy.GetClient()
109+
verifyConfigMapExists(ctx, "aws-auth", metav1.NamespaceSystem, workloadClient)
110+
}
108111
}
109112

110113
// DeleteClusterSpecInput is the input to DeleteClusterSpec.

0 commit comments

Comments
 (0)