Skip to content

Commit

Permalink
Fix for TestServerSideApplyWithDefaulting
Browse files Browse the repository at this point in the history
Signed-off-by: muhammad adil ghaffar <muhammad.adil.ghaffar@est.tech>
  • Loading branch information
adilGhaffarDev committed Mar 26, 2024
1 parent 56e7074 commit 885c5a5
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -651,9 +651,14 @@ func TestServerSideApplyWithDefaulting(t *testing.T) {
g.Expect(env.CleanupAndWait(ctx, kct.DeepCopy())).To(Succeed())
}()

// Wait until the initial KubeadmConfigTemplate is visible in the local cache. Otherwise the test fails below.
g.Eventually(ctx, func(g Gomega) {
g.Expect(env.Get(ctx, client.ObjectKeyFromObject(kct), &bootstrapv1.KubeadmConfigTemplate{})).To(Succeed())
}, 5*time.Second).Should(Succeed())

// Enable the new defaulting logic (i.e. simulate the Cluster API update).
// The webhook will default the users field to `[{Name: "default-user"}]`.
g.Expect(env.Create(ctx, mutatingWebhookConfiguration)).To(Succeed())
g.Expect(env.CreateAndWait(ctx, mutatingWebhookConfiguration)).To(Succeed())
defer func() {
g.Expect(env.CleanupAndWait(ctx, mutatingWebhookConfiguration)).To(Succeed())
}()
Expand Down

0 comments on commit 885c5a5

Please sign in to comment.