Skip to content

fix: treat NotFound from pod delete in rolling update as success#840

Open
AruneshDwivedi wants to merge 1 commit into
apache:mainfrom
AruneshDwivedi:fix/delete-pod-notfound
Open

fix: treat NotFound from pod delete in rolling update as success#840
AruneshDwivedi wants to merge 1 commit into
apache:mainfrom
AruneshDwivedi:fix/delete-pod-notfound

Conversation

@AruneshDwivedi

Copy link
Copy Markdown

DeletePodForUpdate deletes the target pod with a UID precondition, but any error from that delete (including Already-NotFound) was logged and surfaced as a PodUpdateError warning. When the pod is already gone - the desired postcondition for this update path - the StatefulSet recreates it, so the NotFound is expected. Now apierrors.IsNotFound is checked and treated as success (normal PodUpdate event) while other delete errors still warn. Added two regression tests (NotFound -> normal event, real error -> warning). Verified with go build, go vet, and the targeted tests pass; the package's Ginkgo/ envtest BeforeSuite is environment-dependent and not related to this change.

Signed-off-by: Arunesh Dwivedi <arunesh.dwivedi@gmail.com>
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