Skip to content

fix(customrun): return error when customrun is not found during delete - #3336

Open
shubhamrai9122-creator wants to merge 1 commit into
tektoncd:mainfrom
shubhamrai9122-creator:fix-customrun-delete-exit-code
Open

shubhamrai9122-creator wants to merge 1 commit into
tektoncd:mainfrom
shubhamrai9122-creator:fix-customrun-delete-exit-code

Conversation

@shubhamrai9122-creator

Copy link
Copy Markdown

Changes

Fixes #3329

Previously, deleteCustomRuns printed a 'not found' message when customRunExists returned an error, but skipped the resource without recording the error into deleteErr. As a result, tkn customrun delete exited 0 even when specified resources were not found.

This commit records lookup errors using multierr.Append to align CustomRun delete behavior with Task and Pipeline delete:

  • Missing names still print the message and are skipped.
  • Existing names are still deleted and reported.
  • The command returns an error if any name was not found.

Submitter Checklist

  • Includes tests
  • Commit messages follow commit message best practices

Release Notes

Fix tkn customrun delete to return a non-zero exit code when a specified customrun is not found.

Previously, deleteCustomRuns printed a 'not found' message when
customRunExists returned an error, but skipped the resource without
recording the error into deleteErr. As a result, tkn customrun delete
exited 0 even when specified resources were not found.

This commit records lookup errors using multierr.Append to align
CustomRun delete behavior with Task and Pipeline delete.

Fixes tektoncd#3329

Signed-off-by: shubhamrai9122-creator <shubhamrai9122@gmail.com>
@tekton-robot tekton-robot added the release-note Denotes a PR that will be considered when it comes time to generate release notes. label Oct 10, 2026
@tekton-robot

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
To complete the pull request process, please assign chmouel after the PR has been reviewed.
You can assign the PR to them by writing /assign @chmouel in a comment when ready.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@linux-foundation-easycla

linux-foundation-easycla Bot commented Oct 10, 2026 •

Copy link
Copy Markdown

CLA Signed
The committers listed above are authorized under a signed CLA.

  • ✅ login: shubhamrai9122-creator / name: shubhamrai9122-creator (6838250)

@tekton-robot tekton-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Oct 10, 2026
@pratap0007

Copy link
Copy Markdown
Contributor

@shubhamrai9122-creator Thank you for the contribution, could you please sign the CLA?

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Approval recommended

The focused fix preserves successful results, propagates failures, and includes regression coverage with no unresolved findings.

No open issues 🎉

What changed in this PR

Fixes #3329 by making tkn customrun delete return an error when a requested resource is missing, while preserving successful deletions.

Changes:

  • Accumulates lookup and deletion errors.
  • Strengthens error assertions and adds regression coverage for mixed successful and missing resources.
File Description
pkg/​cmd/​customrun/​delete.go Collects errors without stopping successful deletions.
pkg/​cmd/​customrun/​delete_test.go Updates error expectations and tests partial success with JSON output.

Review effort: Balanced

@shubhamrai9122-creator

Copy link
Copy Markdown
Author

@pratap0007 Thanks for the review! I've signed the CLA, and the EasyCLA check is passing now. The PR is ready for another look whenever you have time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release-note Denotes a PR that will be considered when it comes time to generate release notes. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

tkn customrun delete exits 0 and silently succeeds when resource is not found

4 participants