From 0d348487fad2fd440afab157f17970a16f310877 Mon Sep 17 00:00:00 2001 From: Maskym Vavilov Date: Thu, 4 Jan 2024 10:41:50 +0000 Subject: [PATCH] patch in e2e --- test/e2e/gateway_single_spoke_test.go | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/test/e2e/gateway_single_spoke_test.go b/test/e2e/gateway_single_spoke_test.go index 2d509e0e..ed323696 100644 --- a/test/e2e/gateway_single_spoke_test.go +++ b/test/e2e/gateway_single_spoke_test.go @@ -314,7 +314,7 @@ var _ = Describe("Gateway single target cluster", func() { return false } return meta.IsStatusConditionTrue(dnsrecord.Status.Conditions, string(conditions.ConditionTypeReady)) - }).WithTimeout(300 * time.Second).WithPolling(10 * time.Second).WithContext(ctx).Should(BeTrue()) + }).WithTimeout(600 * time.Second).WithPolling(10 * time.Second).WithContext(ctx).Should(BeTrue()) // still need to wait some seconds to the dns server to actually start // resolving the hostname @@ -368,8 +368,9 @@ var _ = Describe("Gateway single target cluster", func() { if gw.Spec.Listeners == nil { gw.Spec.Listeners = []gatewayapiv1.Listener{} } + patch := client.MergeFrom(gw.DeepCopy()) AddListener("wildcard", testHostnameWildcard, gatewayapiv1.ObjectName(testHostname), gw) - err = tconfig.HubClient().Update(ctx, gw) + err = tconfig.HubClient().Patch(ctx, gw, patch) Expect(err).ToNot(HaveOccurred()) Eventually(func(g Gomega, ctx SpecContext) { checkGateway := &gatewayapiv1.Gateway{} @@ -426,9 +427,10 @@ var _ = Describe("Gateway single target cluster", func() { if gw.Spec.Listeners == nil { gw.Spec.Listeners = []gatewayapiv1.Listener{} } + patch := client.MergeFrom(gw.DeepCopy()) AddListener("other", testHostnameOther, gatewayapiv1.ObjectName(testHostnameOther), gw) Eventually(func(g Gomega, ctx SpecContext) { - err = tconfig.HubClient().Update(ctx, gw) + err = tconfig.HubClient().Patch(ctx, gw, patch) Expect(err).ToNot(HaveOccurred()) checkGateway := &gatewayapiv1.Gateway{} err = tconfig.HubClient().Get(ctx, client.ObjectKey{Name: testID, Namespace: tconfig.HubNamespace()}, checkGateway) @@ -445,6 +447,7 @@ var _ = Describe("Gateway single target cluster", func() { // remove the listener err = tconfig.HubClient().Get(ctx, client.ObjectKey{Name: testID, Namespace: tconfig.HubNamespace()}, gw) Expect(err).ToNot(HaveOccurred()) + patch = client.MergeFrom(gw.DeepCopy()) if gw.Spec.Listeners == nil { gw.Spec.Listeners = []gatewayapiv1.Listener{} @@ -455,7 +458,7 @@ var _ = Describe("Gateway single target cluster", func() { gw.Spec.Listeners = append(gw.Spec.Listeners[:i], gw.Spec.Listeners[i+1:]...) } } - err = tconfig.HubClient().Update(ctx, gw) + err = tconfig.HubClient().Patch(ctx, gw, patch) Expect(err).ToNot(HaveOccurred()) Eventually(func(g Gomega, ctx SpecContext) { secret := &corev1.Secret{}