fix: handle pod-not-found error in DelNetwork - #3831
Open
Rajkaran-122 wants to merge 1 commit into
Open
Conversation
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. |
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.
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 KubernetesNotFounderror.GetPod()was converting the original Kubernetes error into a formatted string, which preventedk8serror.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:
DelNetwork()pod-not-found scenario.gofmt.git diff --check.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.