Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 22 additions & 1 deletion test/e2e/gateway_api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -658,7 +658,28 @@ func testGatewayAPIDNSListenerUpdate(t *testing.T) {
}

if err := kclient.Delete(context.TODO(), gateway); err != nil {
t.Errorf("failed to delete gateway %q: %v", gateway.Name, err)
t.Fatalf("Failed to delete gateway %q: %v", gateway.Name, err)
Copy link
Member

@rikatz rikatz Aug 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we care about the same problems of networking here? eg.: do you want to retry the delete also?

Additionally, if you do add this delete to the retry function below, it is worth ignoring the error if the object does not exist, as previous loop may have deleted it.

One more comment, out of this change but above on line 646: I would add a RetryOnConflict for that update/patch, as you may have other controllers (GatewayAPI/OSSM) changing it, the Update may fail with a conflict. It would be good to ignore and retry the update

Edit: OTOH it may lead to a false negative if you try to get a service name that doesn't match the gateway name, as it will be not found

}
t.Logf("Deleted gateway %q", gateway.Name)

// The load balancer deprovisioning can take some time.
// Signal a long deprovisioning to help distinguish it from DNS management problems.
gtwSvcName := types.NamespacedName{Namespace: "openshift-ingress", Name: "test-gateway-update-openshift-default"}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IIRC the service name is derived from the Gateway name, so instead of calling it "test-gateway-update-openshift-default" do you want to compose the name from the gateway name? This way in case of some change on some logic/naming it will not break the test

t.Logf("Checking the deletion of service %q", gtwSvcName)
if err := wait.PollUntilContextTimeout(context.Background(), 3*time.Second, 3*time.Minute, false, func(ctx context.Context) (bool, error) {
svc := &corev1.Service{}
if err := kclient.Get(ctx, gtwSvcName, svc); err != nil {
if kerrors.IsNotFound(err) {
t.Logf("Service %q is deleted", gtwSvcName)
return true, nil
}
t.Logf("Failed to get service %q: %v, retrying ...", gtwSvcName, err)
return false, nil
}
t.Logf("Service %q still exists, retrying ...", gtwSvcName)
return false, nil
}); err != nil {
t.Logf("Timed out waiting for the service %q to finalize the deletion", gtwSvcName)
}

t.Logf("Checking the remaining DNSRecord %s gets deleted after gateway deletion.", "baz."+domain+".")
Expand Down