cli
cli copied to clipboard
Add `tkn` cli support to rerun an existing resolver based pipelinerun
Feature request
CLI option to rerun a resolver based pipelinerun
Use case
As a CLI user I want to be able to rerun a resolver based pipelinerun simply by referencing an existing pipelineRun name
UI Example
$ tkn pipelinerun rerun <pipelinerun-name>
/area roadmap
/assign
Hi @anithapriyanatarajan , Should the tkn pipelinerun rerun command serve as a general-purpose command for rerunning any PipelineRun, or should it be only supporting rerunning resolver-based PipelineRuns?
@pratap0007 - Thank you. As you have mentioned it would be correct for the command to enable the rerun of any PipelineRun, not just those that were resolver-based.
Hi @anithapriyanatarajan, Currently tkn cli, support two command to rerun the pipelinerun from a pipeline under tkn p start command
- tkn p start --last <pipeline_name>
this command re-run the Pipeline using last PipelineRun values - tkn p start <pipeline_name> --usepipelinerun <pipelinerun_name>
rerun the pipeline by using --usepipelinerun values to re-run the pipeline.
so, should we implement command tkn pipelinerun rerun to rerun the pipelinerun as it looks like similar use case have in the existing command? cc: @tektoncd/cli-collaborators
what do you mean by "enable the rerun of any PipelineRun, not just those that were resolver-based." in which context?
@pratap0007 @chmouel - I am sorry to have confused this a bit.
It was created explicitly to sort out the missing rerun behavior for resolver based pipeline runs.
$tkn pipeline start <pipeline-name> -n demo-1 --use-pipelinerun <existing-pr-name> . Here the cli always expects a pipeline name that exists in the cluster. With resolver the logic has to be enhanced to retrieve the pipelinedef from the existing resolution request or using the resolver params of the PipelineRun
I shall share the internal slack thread in this regards.
So, this issue was explicitly for ensuring ability to rerun a resolverbased PR from CLI
there is no pipeline restart, there is only pipelinerun, for cli i made tkn pr export for that usecase, ie:
% tkn pr export -n scratch-my-back fifth-pr-from-pac-ssh2w|k create -f-
maybe we can the ui better but i think we can just document it better
I explored the tkn pr export command and found that it is primarily used for exporting a PipelineRun from one namespace to another. For example, as we can use tkn pr export -n scratch-my-back fifth-pr-from-pac-ssh2w | kubectl create -f - to recreate a PipelineRun in a different namespace.
However, this approach doesn't not look ideal for rerunning a PipelineRun within the same namespace. tkn pipelinerun rerun <pipelinerun-name> command is much more user-friendly and straightforward for rerunning a pipeline.
WDYT: @chmouel @anithapriyanatarajan @tektoncd/cli-maintainers
@pratap0007 if we add a generate name we can do a rename,
we can just leverage on this for the rerun command, that's what i meant by better UI
@pratap0007 if we add a generate name we can do a rename,
we can just leverage on this for the rerun command, that's what i meant by better UI
Hi @chmouel, I didn't fully understand. Are you suggesting to rename the PipelineRun using generateName, and then use the tkn export command to re-run it?
@pratap0007 - There was another suggestion for user experience as alternate to specifying pipelinerun name in today's working group call to incorporate a --flag to indicate that the pipeline is remote. Something like - tkn p start --last <pipeline_name> --resolvertype=remote