Skip to content

fix: handle pod-not-found error in DelNetwork - #3831

Open
Rajkaran-122 wants to merge 1 commit into
aws:masterfrom
Rajkaran-122:fix/delnetwork-pod-not-found-final
Open

fix: handle pod-not-found error in DelNetwork#3831
Rajkaran-122 wants to merge 1 commit into
aws:masterfrom
Rajkaran-122:fix/delnetwork-pod-not-found-final

Conversation

@Rajkaran-122

@Rajkaran-122 Rajkaran-122 commented Aug 15, 2026

Copy link
Copy Markdown

What type of PR is this?:
bug

Which issue does this PR fix?:
#3777

What does this PR do / Why do we need it?:
When a pod has already been deleted from the cluster, the DelNetwork() flow does not correctly recognize the Kubernetes NotFound error.

GetPod() was converting the original Kubernetes error into a formatted string, which prevented k8serror.IsNotFound() from identifying the error correctly.

This change preserves the original Kubernetes error and updates the related pod annotation handling to use k8serror.IsNotFound().

A dedicated unit test is also added to verify that DelNetwork() gracefully succeeds when the requested pod is no longer present.

Testing done on this change:

  • Added a unit test covering the DelNetwork() pod-not-found scenario.
  • Ran gofmt.
  • Ran git diff --check.
  • Verified the changes are limited to the required production code and unit test.

Will this PR introduce any new dependencies?:
No.

Will this break upgrades or downgrades? Has updating a running cluster been tested?:
No. The change only improves error handling and does not change configuration, APIs, or upgrade behavior.

Does this change require updates to the CNI daemonset config files to work?:
No.

Does this PR introduce any user-facing change?:
No.

@Rajkaran-122
Rajkaran-122 requested a review from a team as a code owner August 15, 2026 15:10
@Rajkaran-122

Copy link
Copy Markdown
Author

Hi @jaydeokar sir , I’ve opened an independent PR for issue #3777 with the DelNetwork() pod-not-found fix and a dedicated regression test covering the deleted-pod case. The change preserves the Kubernetes NotFound error so it can be correctly recognized by k8serror.IsNotFound(). Would appreciate your review.

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.

1 participant