Skip to content

Commit 284a92f

Browse files
authored
Merge pull request #10307 from Nordix/TestServerSideApplyWithDefaulting-fix/adil
🐛 Fix for TestServerSideApplyWithDefaulting
2 parents 852e788 + 6cb0a98 commit 284a92f

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)