Skip to content

fix: preserve PipelineRun-owned TaskRuns during history pruning - #424

Open
yuzichen12123 wants to merge 1 commit into
tektoncd:mainfrom
yuzichen12123:fix/exclude-pipelinerun-owned-taskruns
Open

yuzichen12123 wants to merge 1 commit into
tektoncd:mainfrom
yuzichen12123:fix/exclude-pipelinerun-owned-taskruns

Conversation

@yuzichen12123

Copy link
Copy Markdown

Summary

History-limit cleanup can delete completed TaskRuns that belong to a still-running PipelineRun. The PipelineRun controller then treats those tasks as unscheduled and recreates them, causing completed pipeline work to run again.

This change excludes PipelineRun-owned resources from the history-limiter candidate set. It recognizes both ownership signals used by Tekton:

  • the tekton.dev/pipelineRun label;
  • a PipelineRun ownerReference.

The ownerReference check protects resources that do not carry the label.

Fixes #381

Testing

  • go test ./...

The regression test verifies that history pruning removes eligible standalone resources while preserving PipelineRun children identified by either ownership mechanism.

@tekton-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
To complete the pull request process, please assign anithapriyanatarajan after the PR has been reviewed.
You can assign the PR to them by writing /assign @anithapriyanatarajan 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

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

Labels

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.

History-limit pruning deletes TaskRuns owned by a still-running PipelineRun, causing the pipeline task to re-run

2 participants