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

Can't rerun existing completed taskruns or delete completed taskruns automatically #1302

Closed
anxinyf opened this issue Sep 12, 2019 · 7 comments
Labels
kind/question Issues or PRs that are questions around the project or a particular feature lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale.

Comments

@anxinyf
Copy link

anxinyf commented Sep 12, 2019

Expected Behavior

There can be some fields that can automatically delete taskruns or completed pods if necessary.

If you don't want to delete existing succeeded taskruns, please allow me to rerun the same name of taskrun, like kubectl apply which can configure the same Deployment and the pod will rerun.

Actual Behavior

At present, when a taskrun is succeeded and the related pod is completed, they have not been deleted and cannot be re-run.

Sure, there's other way to delete taskrun and pod, such as kubectl delete, but there may be so many existing completed taskruns to rerun. To do so, first , i have to delete the exising taskruns and pods, then rerun. Even if I only delete related pod, I can't rerun taskRun.

Steps to Reproduce the Problem

  1. When pod is completed, i rerun "kubectl apply -f taskrun.yaml", pod cannot rerun.
  2. Delete pod but not related taskrun, apply taskrun.yaml, pod also cannot rerun.
  3. Delete taskrun(of course, pod will be deleted), apply taskrun.yaml, pod can rerun.
  4. Maybe PipelineRun is same with taskRun.
@vdemeester
Copy link
Member

@anxinyf Thanks for the issue. TaskRun represents one execution of a Task (same for PipelineRun and Pipeline), which means they are a one-shot type of object, and can't be restart. This is by design. As other objects, if you delete the underlying representation (here a Pod), it won't delete the TaskRun ; but the opposite is true.

If you want to re-run the exact same TaskRun (aka same Task with same params and resources) you can do one of the following:

  • delete the TaskRun and re-apply it
  • use generateName and and kubectl create (instead of apply)
  • use the tkn command line (see tektoncd/cli), tkn pipeline start --last (we need one for task I feel)

/kind question

@tekton-robot tekton-robot added the kind/question Issues or PRs that are questions around the project or a particular feature label Sep 12, 2019
@anxinyf
Copy link
Author

anxinyf commented Sep 16, 2019

@vdemeester Would Pipeline or Operator like to design some fields used in yaml which means that succeeded taskruns can be deleted automatically after ttl time , or they can be deleted in batches?

@anxinyf
Copy link
Author

anxinyf commented Oct 9, 2019

@anxinyf anxinyf changed the title Can't rerun existing completed taskruns Can't rerun existing completed taskruns or delete completed taskruns automatically Oct 15, 2019
@jlewi
Copy link

jlewi commented Jan 16, 2020

In case its helpful here are some links to how this problem has been solved for other resources

@tekton-robot
Copy link
Collaborator

Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen.
Mark the issue as fresh with /remove-lifecycle rotten.

/close

Send feedback to tektoncd/plumbing.

@tekton-robot
Copy link
Collaborator

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.
If this issue is safe to close now please do so with /close.

/lifecycle stale

Send feedback to tektoncd/plumbing.

@tekton-robot tekton-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Aug 13, 2020
@tekton-robot
Copy link
Collaborator

@tekton-robot: Closing this issue.

In response to this:

Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen.
Mark the issue as fresh with /remove-lifecycle rotten.

/close

Send feedback to tektoncd/plumbing.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/question Issues or PRs that are questions around the project or a particular feature lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants