Allow using PipelineRun delete arguments "keep" and "keepSince" together
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 461
- Forks
- 277
- Avg merge
- 16h 48m
- Merged PRs (30d)
- 95
Description
Feature request
We're using Tekton Operator Pruner to delete old PipelineRuns from the cluster. Tekton Operator Pruner uses Tekton CLI to delete PipelineRuns. However, it's impossible to delete PipelineRuns both by their age and count in the namespace.
Allow using PipelineRun delete arguments "keep" and "keepSince" together.
Use case
Tekton runs PipelineRuns in multiple, dynamically created namespaces, some namespaces get more traffic, others - less (for understanding: production and development branch namespace).
- Setting only
keep-sinceargument is not an option because more active namespaces will hold too many irrelevant (old) PipelineRuns, this is a problem because having too many PipelineRuns in the cluster is in general bad - it affects Tekton performance - high CPU usage for controller, slow WEB UI, from our observations - the acceptable amount of total PipelineRuns in the cluster is around 2k. - Setting only
keepargument is not an option, because some less often-used namespaces will keep irrelevant (old) PipelineRuns until the threshold is reached and again the problem here is that old PipelineRuns from multiple namespaces with less traffic stack up and the total number of PipelineRuns is too high in the Cluster.
Setting any of these settings to a low value is not an option, because then still relevant information may be deleted.
Having the ability to set both of these at the same time would help for the mentioned problems: it would be possible to set "keep" to like 500 PipelineRuns (this solves the problem of high-traffic namespaces) and "keep-since" with age of like 14 days to remove irrelevant (old) PipelineRuns (that would be beneficial for namespaces with not so much activity).
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the PipelineRun delete command and trace how the keep and keep-since arguments are currently handled. Add coverage for using both arguments together, and verify that deletion respects both the count and age limits.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- cli
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100