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

Delete taskruns related to pipeline #601

Closed
wants to merge 1 commit into from
Closed

Delete taskruns related to pipeline #601

wants to merge 1 commit into from

Conversation

ghost
Copy link

@ghost ghost commented Jan 14, 2020

Changes

Fixes #588

This PR updates the deleter helper to support removing multiple kinds of related resources and adds some testing around that behaviour.

This PR then updates the pipeline delete command so that specifying --all causes related taskruns as well as pipelineruns to be deleted.

Submitter Checklist

  • Includes tests (if functionality changed/added)
  • Includes docs (if user facing)
  • Regenerate the manpages and docs with make docs and make man if needed.
  • Run the code checkers with make check
  • Commit messages follow commit message best practices

See the contribution guide
for more details.

Release Notes

Deleting a pipeline with the --all flag will now delete related taskruns as well as pipelineruns.

@tekton-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
To complete the pull request process, please assign vdemeester
You can assign the PR to them by writing /assign @vdemeester in a comment when ready.

The full list of commands accepted by this bot can be found 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 size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Jan 14, 2020
@tekton-robot
Copy link
Contributor

The following is the coverage report on pkg/.
Say /test pull-tekton-cli-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/cmd/pipeline/delete.go 93.9% 88.6% -5.3
pkg/helper/deleter/deleter.go 50.0% 100.0% 50.0

Update the deleter helper to support removing multiple kinds of
related resources and adds some testing around that behaviour.

Updates the pipeline delete command so that specifying --all flag
causes related taskruns as well as pipelineruns to be deleted.
@tekton-robot
Copy link
Contributor

The following is the coverage report on pkg/.
Say /test pull-tekton-cli-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/cmd/pipeline/delete.go 93.9% 88.6% -5.3
pkg/helper/deleter/deleter.go 50.0% 100.0% 50.0

@ghost
Copy link
Author

ghost commented Jan 14, 2020

Actually... I don't think we need this after all! Deleting a pipeline run also deletes the taskruns that it generated.

@ghost
Copy link
Author

ghost commented Jan 14, 2020

lol, I misread the feature request and implemented something nobody asked for.

We want to delete taskruns of pipelineruns. I believe this happens automatically when deleting a pipelinerun:

λ kubectl get pipelineruns
NAME                  SUCCEEDED   REASON    STARTTIME   COMPLETIONTIME
demo-pipeline-run-1   Unknown     Running   7s          

λ kubectl get taskruns
NAME                                            SUCCEEDED   REASON      STARTTIME   COMPLETIONTIME
demo-pipeline-run-1-build-skaffold-app-588ps    Unknown     Pending     1s          
demo-pipeline-run-1-build-skaffold-web-z8fx8    Unknown     Pending     1s          
demo-pipeline-run-1-skaffold-unit-tests-997cv   True        Succeeded   9s          1s

λ tkn pr delete demo-pipeline-run-1
Are you sure you want to delete pipelinerun "demo-pipeline-run-1" (y/n): y
PipelineRun deleted: demo-pipeline-run-1

λ kubectl get pipelineruns
No resources found in default namespace.

λ kubectl get taskruns
No resources found in default namespace.

@ghost ghost closed this Jan 14, 2020
@tekton-robot
Copy link
Contributor

The following is the coverage report on pkg/.
Say /test pull-tekton-cli-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/cmd/pipeline/delete.go 93.9% 88.6% -5.3
pkg/helper/deleter/deleter.go 50.0% 100.0% 50.0

This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes 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.

Feature Request: Delete TaskRuns Associated with a PipelineRun
2 participants