tektoncd / tektoncd/cli

issue with keep and keep-since in taskrun and in pipelinerun

Open
#1,990 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

kind/bug
Dominant language
Go
Stars
461
Forks
277
Avg merge
16h 48m
Merged PRs (30d)
95

Description

tkn version: 0.30.1

keep and keep-since support is introduced in https://github.com/tektoncd/cli/pull/1533
though, when we supply keep and keep-since simultaneously
the out come always equivalent to keep, keep-since ignored

Pipelinerun:
https://github.com/tektoncd/cli/blob/f4d092c77d359a48dfdecf708f72293ebf872f5a/pkg/cmd/pipelinerun/delete.go#L329-L338

taskrun:
https://github.com/tektoncd/cli/blob/f4d092c77d359a48dfdecf708f72293ebf872f5a/pkg/cmd/taskrun/delete.go#L379-L388

Expected behavior
  • tkn taskrun delete --keep=5 --keep-since=30
  • after executed the above command, remaining taskruns will be as count <= 5 and start-time <= 30 minutes
  • this is applicable for pipelineruns too

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the cited sections of pkg/cmd/pipelinerun/delete.go and pkg/cmd/taskrun/delete.go, then reproduce the behavior with --keep=5 and --keep-since=30. Trace how the two options are applied for both commands. Done means both constraints are honored together, leaving no more than five runs started within the specified 30-minute window.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.