-
Notifications
You must be signed in to change notification settings - Fork 218
NE-2032: e2e: Signal service deprovisioning issues during Gateway DNS test #1220
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
alebedev87
wants to merge
1
commit into
openshift:master
Choose a base branch
from
alebedev87:dnsrecord-listener-update
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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) | ||
| } | ||
| 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"} | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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+".") | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
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