fix: preserve PipelineRun-owned TaskRuns during history pruning - #424
yuzichen12123 wants to merge 1 commit into
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #424 +/- ##
==========================================
+ Coverage 50.40% 50.56% +0.16%
==========================================
Files 19 19
Lines 2113 2120 +7
==========================================
+ Hits 1065 1072 +7
Misses 916 916
Partials 132 132
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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:
tekton.dev/pipelineRunlabel;PipelineRunownerReference.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.