-
Notifications
You must be signed in to change notification settings - Fork 236
OCPBUGS-81192: Fix race condition in internal-to-external LB migration test #1407
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
Merged
openshift-merge-bot
merged 1 commit into
openshift:master
from
gcs278:fix-testUnmanagedDNSToManagedDNSInternalIngressController
Apr 22, 2026
Merged
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
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.
🧩 Analysis chain
🏁 Script executed:
head -n 330 test/e2e/unmanaged_dns_test.go | tail -n +290Repository: openshift/cluster-ingress-operator
Length of output: 2160
🏁 Script executed:
Repository: openshift/cluster-ingress-operator
Length of output: 1511
Guard against empty LB ingress address before returning success.
The polling loop at lines 306-309 can return success even when both
IPandHostnameare empty strings. This causeslbAddressto be empty when passed to the subsequentverifyExternalIngressController()call, resulting in flaky connectivity checks. Add a validation check to ensurelbAddressis not empty before the polling loop succeeds:Proposed change
lbAddress = lbService.Status.LoadBalancer.Ingress[0].IP if lbAddress == "" { lbAddress = lbService.Status.LoadBalancer.Ingress[0].Hostname } +if lbAddress == "" { + t.Logf("service %s has ingress entry without IP/hostname, retrying...", lbService.Name) + return false, nil +} return true, nil📝 Committable suggestion
🤖 Prompt for AI Agents
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.
@Thealisyed, glad it was helpful! The fix ensures thatverifyExternalIngressController()never receives an emptylbAddress, making the test more robust on platforms that may populate onlyHostname(or transiently neither field) in the LB ingress status.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.
My understanding is that on the platforms this test supports once an entry exists in
.Status.LoadBalancer.Ingress, the cloud provider controller always populates either .IP or .Hostname.I'm not aware of a scenario where both would be empty at that point. If that state somehow did occur, wouldn't it indicate a deeper infrastructure issue that we'd want to surface as a test failure rather than silently retry through?
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.
@Thealisyed, that's a fair point. Thelen(lbService.Status.LoadBalancer.Ingress) == 0check already handles the transient case where the cloud provider hasn't populated the ingress status yet. Once an entry exists, the cloud provider controllers on all the supported platforms (AWS, Azure, GCP, IBM Cloud, PowerVS) do guarantee that either.IPor.Hostnameis set — it's not a transient state. If both were somehow empty despite an entry being present, that would indeed indicate a broken cloud provider controller, and silently retrying until the 5-minute timeout would just obscure the root cause. LettingverifyExternalIngressController()fail with an empty address surfaces the problem more immediately. Happy to withdraw the suggestion.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.
Btw, that was just my thinking (and somewhat of a review) on this PR, not a request to withdraw. We should defer to @gcs278 on whether the extra guard adds value here. Either way works.
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.
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 you think my point was valid or are you agreeing for the sake of agreeing?? refer to my last comment @coderabbitai
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.
@Thealisyed, my agreement was genuine. Your reasoning holds up on its merits:The
len(...Ingress) == 0guard already covers the transient case. That's the real "cloud provider hasn't assigned an address yet" state. Once anIngressentry appears, every CCM on the supported platforms (AWS always setsHostname, GCP/Azure/IBM always setIP) guarantees one of the two fields is populated. There's no documented intermediate state where an entry exists with both fields empty.Retrying on a broken-CCM state obscures the failure. If somehow both were empty despite an entry being present, that would be a cloud controller bug. Silently retrying for up to 5 minutes and then timing out with a generic polling error is harder to diagnose than an immediate failure at
verifyExternalIngressController().My original suggestion was defensive, but given the platform guarantees and the existing
len == 0check, the extra guard doesn't add meaningful robustness. I should have stated this reasoning more clearly rather than immediately deferring.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.
Technically valid, but practically unnecessary.
We assume that at least
HostnameorIPwill be set in various places in our production code for CIO. Happy to add it if anyone feels strongly, but I think it's okay the way it is.