Skip to content

Commit 58e6b48

Browse files
authored
Merge pull request kubernetes-sigs#6789 from killianmuldoon/flake/e2e-clusterclass-retry
🐛 Retry Apply workloadClusterTemplate to fix flake
2 parents e3d327e + 0a16ff8 commit 58e6b48

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

test/framework/clusterctl/clusterctl_helpers.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import (
2020
"context"
2121
"os"
2222
"path/filepath"
23+
"time"
2324

2425
. "github.com/onsi/gomega"
2526

@@ -270,7 +271,9 @@ func ApplyClusterTemplateAndWait(ctx context.Context, input ApplyClusterTemplate
270271
Expect(workloadClusterTemplate).ToNot(BeNil(), "Failed to get the cluster template")
271272

272273
log.Logf("Applying the cluster template yaml to the cluster")
273-
Expect(input.ClusterProxy.Apply(ctx, workloadClusterTemplate, input.Args...)).To(Succeed())
274+
Eventually(func() error {
275+
return input.ClusterProxy.Apply(ctx, workloadClusterTemplate, input.Args...)
276+
}, 10*time.Second).Should(Succeed(), "Failed to apply the cluster template")
274277

275278
log.Logf("Waiting for the cluster infrastructure to be provisioned")
276279
result.Cluster = framework.DiscoveryAndWaitForCluster(ctx, framework.DiscoveryAndWaitForClusterInput{

0 commit comments

Comments
 (0)