Skip to content

Commit

Permalink
patch in e2e
Browse files Browse the repository at this point in the history
  • Loading branch information
maksymvavilov committed Jan 4, 2024
1 parent 5e1dd96 commit 0d34848
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions test/e2e/gateway_single_spoke_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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{}
Expand Down Expand Up @@ -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)
Expand All @@ -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{}
Expand All @@ -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{}
Expand Down

0 comments on commit 0d34848

Please sign in to comment.