Skip to content

Conversation

@isaac-dasan
Copy link
Member

  • fix: dhcp error message to include kubelet err msg
  • Update network/secondary_endpoint_client_linux.go

Reason for Change:

Requirements:

Notes:

* 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]>
Copilot AI review requested due to automatic review settings July 11, 2025 23:15
@isaac-dasan isaac-dasan requested a review from a team as a code owner July 11, 2025 23:15
@isaac-dasan isaac-dasan requested a review from jshr-w July 11, 2025 23:15
Copy link
Contributor

Copilot AI left a 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.NetworkNotReadyErrorMsg in 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 errorSecondaryEndpointClient variable 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"

@isaac-dasan
Copy link
Member Author

/azp run Azure Container Networking PR

@isaac-dasan isaac-dasan enabled auto-merge July 11, 2025 23:18
@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Contributor

@sheylatrudo sheylatrudo left a 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.

@isaac-dasan isaac-dasan added this pull request to the merge queue Jul 11, 2025
Merged via the queue into release/v1.6 with commit 9643131 Jul 12, 2025
10 of 15 checks passed
@isaac-dasan isaac-dasan deleted the isaac/swiftv2/perfhdhcperr/1.6backport branch July 12, 2025 01:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants