Skip to content

[Multi_K8s-Plugin] Surface partial deletion errors in deleteResources#6781

Open
mohammedfirdouss wants to merge 2 commits into
pipe-cd:masterfrom
mohammedfirdouss:feat/fix-delete-resources-errors
Open

[Multi_K8s-Plugin] Surface partial deletion errors in deleteResources#6781
mohammedfirdouss wants to merge 2 commits into
pipe-cd:masterfrom
mohammedfirdouss:feat/fix-delete-resources-errors

Conversation

@mohammedfirdouss
Copy link
Copy Markdown
Contributor

@mohammedfirdouss mohammedfirdouss commented May 17, 2026

What this PR does:
Changes deleteResources in deployment/misc.go to return (int, error) instead of just int. All deletion errors are now collected via errors.Join and returned to callers. deleteVariantResources propagates combined errors. Stage functions (sync, primaryRollout) now fail the stage if any resource deletion fails rather than silently succeeding with a partial count.

Why we need it:
Previously, when deleting multiple resources (during prune or variant cleanup), any non-ErrNotFound error was logged but swallowed callers received only the success count and logged "Successfully deleted X resources" with no signal that some resources failed. A partially-failed cleanup appeared as a success.

Which issue(s) this PR fixes:

Fixes #6446

Does this PR introduce a user-facing change?:

  • How are users affected by this change: A deployment stage that previously reported success despite partial resource deletion failures will now correctly report failure, allowing the pipeline to retry or alert.
  • Is this breaking change: No, this is a correctness fix. The deletion behaviour (best-effort, continues after individual failures) is unchanged.
  • How to migrate (if breaking change): N/A

…teResources

Signed-off-by: Mohammed Firdous <124298708+mohammedfirdouss@users.noreply.github.com>
@mohammedfirdouss mohammedfirdouss force-pushed the feat/fix-delete-resources-errors branch from f1399a5 to 8108439 Compare May 17, 2026 07:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[LFX Mentorship T-1 2026] Kubernetes Multi-Cluster Plugin #6446

1 participant