Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix tkn tr delete command not deleting trs of completed pr #1974

Merged
merged 1 commit into from
Apr 5, 2023

Conversation

pratap0007
Copy link
Contributor

@pratap0007 pratap0007 commented Apr 5, 2023

This will fix the issues of tkn tr delete command
not deleting the completed taskruns of a completed
pipelinerun.
Add tests for the scenario

Fixes: #1972

Signed-off-by: Shiv Verma [email protected]

Submitter Checklist

These are the criteria that every PR should meet, please check them off as you
review them:

  • Includes tests (if functionality changed/added)
  • Run the code checkers with make check
  • Regenerate the manpages, docs and go formatting with make generated
  • Commit messages follow commit message best practices

See the contribution guide
for more details.

Release Notes

Fix tkn tr delete command not deleting trs of completed pr

@tekton-robot tekton-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Apr 5, 2023
@pratap0007 pratap0007 changed the title Fix tkn tr delete command Fix tkn tr delete command not deleting trs of completed pr Apr 5, 2023
This will fix the issues of tkn tr delete command
not deleting the completed taskruns of a completed
pipelinerun.
Add tests for the scenario

Fixes: tektoncd#1972

Signed-off-by: Shiv Verma <[email protected]>
@@ -400,7 +400,7 @@ func ownerPrFinished(cs *cli.Clients, tr v1.TaskRun) bool {
for _, ref := range tr.GetOwnerReferences() {
if ref.Kind == pipeline.PipelineRunControllerName {
var pr *v1.PipelineRun
err := actions.GetV1(pipelineRunGroupResource, cs, tr.Namespace, ref.Name, metav1.GetOptions{}, &pr)
err := actions.GetV1(pipelineRunGroupResource, cs, ref.Name, tr.Namespace, metav1.GetOptions{}, &pr)
Copy link
Member

Choose a reason for hiding this comment

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

😅

@tekton-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: vinamra28

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

The pull request process is described here

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

@tekton-robot tekton-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 5, 2023
@vinamra28
Copy link
Member

/lgtm

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Apr 5, 2023
@tekton-robot tekton-robot merged commit c558505 into tektoncd:main Apr 5, 2023
vinamra28 added a commit that referenced this pull request Apr 10, 2023
#1965 | [Piyush Garg] Update readme, release date and choco for 0.30 | 2023/03/27-15:32
#1966 | [dependabot[bot]] Bump github.com/docker/docker | 2023/03/29-17:52
#1967 | [dependabot[bot]] Bump github.com/docker/cli | 2023/03/30-04:46
#1971 | [dependabot[bot]] Bump github.com/tektoncd/triggers from 0.23.0 to 0.23.1 | 2023/04/04-06:36
#1973 | [dependabot[bot]] Bump github.com/spf13/cobra from 1.6.1 to 1.7.0 | 2023/04/04-17:08
#1974 | [pratap0007] Fix tkn tr delete command not deleting trs of completed pr | 2023/04/05-17:37
#1975 | [dependabot[bot]] Bump github.com/docker/cli | 2023/04/06-06:01
#1977 | [dependabot[bot]] Bump github.com/docker/docker | 2023/04/06-07:27
#1978 | [dependabot[bot]] Bump golang.org/x/term from 0.6.0 to 0.7.0 | 2023/04/07-10:23
#1979 | [dependabot[bot]] Bump golang.org/x/net from 0.8.0 to 0.9.0 | 2023/04/07-15:09
null | [dependabot[bot]] Bump golang.org/x/crypto from 0.7.0 to 0.8.0 | 2023/04/07-16:01

Signed-off-by: vinamra28 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

tkn tr delete --keep <n> does not work when pipelineruns are present
3 participants