agent: don't discard network status on IPv4-only route lookup failure - #233
Open
sebastian-pf9 wants to merge 1 commit into
Open
agent: don't discard network status on IPv4-only route lookup failure#233sebastian-pf9 wants to merge 1 commit into
sebastian-pf9 wants to merge 1 commit into
Conversation
GetNetworkStatus() returned empty whenever the IPv4-only gateway lookup failed, blanking IPv6-only hosts entirely. Now checks both DiscoverInterface() and DiscoverInterfaceIPv6() and enumerates interfaces regardless of either's result. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
indradhanush
approved these changes
Aug 21, 2026
indradhanush
left a comment
Collaborator
There was a problem hiding this comment.
Approve to unblock. Please see comments.
|
|
||
| Expect(status).To(BeEmpty()) | ||
| }) | ||
| }) |
Collaborator
There was a problem hiding this comment.
Can we please rewrite this as table driven non-ginkgo unit tests? I find this format time consuming in terms of evaluating all the test cases.
|
|
||
| // GetNetworkStatus returns the network interface(s) status for the host | ||
| func (hr *HostRegistrar) GetNetworkStatus() []infrastructurev1beta1.NetworkStatus { | ||
| return hr.getNetworkStatus(gateway.DiscoverInterface, gateway.DiscoverInterfaceIPv6, systemInterfaces) |
Collaborator
There was a problem hiding this comment.
This feels like an anti pattern. I think GetNetowrkStatus should accept an interface (Go, not network interface). And the implementations of the interface are something like:
- RealNet (the existing methods that are being passed here instead)
- FakeNet (the fake methods in the test file)
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
GetNetworkStatus() returned empty whenever the IPv4-only gateway lookup failed, blanking IPv6-only hosts entirely. Now checks both DiscoverInterface() and DiscoverInterfaceIPv6() and enumerates interfaces regardless of either's result.
Getting towards full IPv6 support is still some way to go