-
Notifications
You must be signed in to change notification settings - Fork 260
[backport] perf: dhcp err msg in network swiftv2 code path (#3793) #3821
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
[backport] perf: dhcp err msg in network swiftv2 code path (#3793) #3821
Conversation
* fix: dhcp error message to include kubelet err msg Signed-off-by: GitHub <[email protected]> * Update network/secondary_endpoint_client_linux.go Co-authored-by: Copilot <[email protected]> Signed-off-by: Isaac <[email protected]> --------- Signed-off-by: GitHub <[email protected]> Signed-off-by: Isaac <[email protected]> Co-authored-by: Copilot <[email protected]>
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.
Pull Request Overview
This PR backports a fix to include the kubelet network-not-ready message in the DHCP error path and adds a unit test for that failure.
- Include
kubelet.NetworkNotReadyErrorMsgin the wrapped DHCP error - Add a mock DHCP failure client and test case to verify the new error message
- Import required packages (
context,errors,kubelet) in the test
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| network/secondary_endpoint_client_linux.go | Wrap DHCP discovery errors with the kubelet error message |
| network/secondary_endpoint_linux_test.go | Add mock DHCP failure and test case to assert error |
Comments suppressed due to low confidence (3)
network/secondary_endpoint_linux_test.go:401
- The test only asserts the kubelet error substring; consider also verifying that the wrapped error includes the underlying DHCP failure message (
mock DHCP discover request failed) for more thorough coverage.
wantErrMsg: kubelet.NetworkNotReadyErrorMsg,
network/secondary_endpoint_client_linux.go:19
- The
errorSecondaryEndpointClientvariable is declared but never used; consider removing it to reduce dead code and confusion.
var errorSecondaryEndpointClient = errors.New("SecondaryEndpointClient Error")
network/secondary_endpoint_linux_test.go:18
- [nitpick] Importing the internal kubelet package in tests may introduce fragility if that package path changes; consider copying the constant or defining a local alias to decouple from kubelet internals.
"k8s.io/kubernetes/pkg/kubelet"
|
/azp run Azure Container Networking PR |
|
Azure Pipelines successfully started running 1 pipeline(s). |
sheylatrudo
left a comment
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.
Just a minor nit. Otherwise looks good.
Reason for Change:
Requirements:
Notes: