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

Do Not Delete ClusterTask TaskRuns with --task Flag #1227

Merged
merged 1 commit into from
Nov 4, 2020
Merged

Do Not Delete ClusterTask TaskRuns with --task Flag #1227

merged 1 commit into from
Nov 4, 2020

Conversation

danielhelfand
Copy link
Member

When running tkn tr delete with the --task option, if a ClusterTask exists with the same name, the ClusterTask's TaskRuns will also be deleted. This is because of TaskRuns for ClusterTasks having the tekton.dev/task label, which will be removed in January 2021.

For now, the workaround is to filter the TaskRuns by the TaskRefKind, ignoring the run for the deletion process if its kind is ClusterTask. A follow up to this pr should be an option added to tkn tr delete to delete TaskRuns associated with a ClusterTask.

Submitter Checklist

  • 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

Release Notes

Prevent tkn tr delete --task from deleting TaskRuns associated with ClusterTasks

@tekton-robot tekton-robot added the release-note Denotes a PR that will be considered when it comes time to generate release notes. label Oct 29, 2020
@tekton-robot tekton-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Oct 29, 2020
@@ -65,14 +64,3 @@ func FilterByRef(taskruns []v1beta1.TaskRun, kind string) []v1beta1.TaskRun {
}
return filtered
}

// this will filter the taskkrun which have reference to Task
Copy link
Member Author

Choose a reason for hiding this comment

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

This isn't used anywhere in the CLI, so I removed it. Let me know if there are considerations around it I am not aware of.

Copy link
Contributor

Choose a reason for hiding this comment

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

I am also not sure about this.

Copy link
Member Author

Choose a reason for hiding this comment

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

/cc @pradeepitm12 Not sure if you are more familiar with this?

@tekton-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: piyush-garg

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 Nov 2, 2020
@piyush-garg
Copy link
Contributor

/lgtm

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Nov 4, 2020
@piyush-garg
Copy link
Contributor

/test pull-tekton-cli-build-tests

1 similar comment
@danielhelfand
Copy link
Member Author

/test pull-tekton-cli-build-tests

@danielhelfand
Copy link
Member Author

/retest

@tekton-robot tekton-robot merged commit e17ae54 into tektoncd:master Nov 4, 2020
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.

3 participants