Skip to content

fix: wrap handleCommonOptions error with NetworkNotReadyErrorMsg#4411

Open
behzad-mir wants to merge 1 commit into
masterfrom
fix/handlecommonoptions-network-not-ready
Open

fix: wrap handleCommonOptions error with NetworkNotReadyErrorMsg#4411
behzad-mir wants to merge 1 commit into
masterfrom
fix/handlecommonoptions-network-not-ready

Conversation

@behzad-mir
Copy link
Copy Markdown
Contributor

Wrap the error returned from handleCommonOptions in newNetworkImpl with NetworkNotReadyErrorMsg so kubelet treats transient failures (e.g. ENETUNREACH from route installation) as network-not-ready and retries the ADD call in ~1 second.

Reason for Change:

Issue Fixed:

Requirements:

Notes:

Wrap the error returned from handleCommonOptions in newNetworkImpl with
NetworkNotReadyErrorMsg so kubelet treats transient failures (e.g.
ENETUNREACH from route installation) as network-not-ready and retries
the ADD call in ~1 second.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings May 18, 2026 22:56
@behzad-mir behzad-mir requested a review from a team as a code owner May 18, 2026 22:56
@behzad-mir behzad-mir requested a review from aggarwal0009 May 18, 2026 22:56
Copy link
Copy Markdown
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

Wraps the error returned from handleCommonOptions in newNetworkImpl with the NetworkNotReadyErrorMsg sentinel string so that the CNI plugin surfaces transient network setup failures (e.g., ENETUNREACH during route installation) as "network is not ready" to kubelet, which then retries the CNI ADD call sooner (~1s) instead of treating it as a hard error.

Changes:

  • Wrap the error from handleCommonOptions with NetworkNotReadyErrorMsg in network_linux.go::newNetworkImpl.

Comment thread network/network_linux.go
if err != nil {
logger.Error("handleCommonOptions failed with", zap.Error(err))
return nil, err
return nil, errors.Wrap(err, NetworkNotReadyErrorMsg)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Curious how this particular string in the error message changes the behavior of kubelet?
If there is an ADD failure doesn't it already retry?

Also this error message string seems to be used in the context of swiftv2 mtpnc, rather than the vm's networking which applies to all scenarios (even non-swiftv2)

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.

4 participants