Skip to content

Commit 6cb0a98

Browse files
Fix for TestServerSideApplyWithDefaulting
Signed-off-by: muhammad adil ghaffar <muhammad.adil.ghaffar@est.tech>
1 parent 56e7074 commit 6cb0a98

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

internal/controllers/topology/cluster/structuredmerge/serversidepathhelper_test.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -651,6 +651,11 @@ func TestServerSideApplyWithDefaulting(t *testing.T) {
651651
g.Expect(env.CleanupAndWait(ctx, kct.DeepCopy())).To(Succeed())
652652
}()
653653

654+
// Wait until the initial KubeadmConfigTemplate is visible in the local cache. Otherwise the test fails below.
655+
g.Eventually(ctx, func(g Gomega) {
656+
g.Expect(env.Get(ctx, client.ObjectKeyFromObject(kct), &bootstrapv1.KubeadmConfigTemplate{})).To(Succeed())
657+
}, 5*time.Second).Should(Succeed())
658+
654659
// Enable the new defaulting logic (i.e. simulate the Cluster API update).
655660
// The webhook will default the users field to `[{Name: "default-user"}]`.
656661
g.Expect(env.Create(ctx, mutatingWebhookConfiguration)).To(Succeed())

0 commit comments

Comments
 (0)