Skip to content

Using a cancelled taskrun/pipelinerun for the tag --use-taskrun/--use-pipelinerun sets the status of newly created taskrun/pipelinerun to cancelled #1200

@VeereshAradhya

Description

@VeereshAradhya

Versions and Operating System

  • Kubernetes version:

    Output of kubectl version:

    Client Version: version.Info{Major:"1", Minor:"10+", GitVersion:"v1.10.0+b3b92b2", GitCommit:"b3b92b2", GitTreeState:"clean", BuildDate:"2020-07-15T09:27:21Z", GoVersion:"go1.14.3", Compiler:"gc", Platform:"linux/amd64"}
    Server Version: version.Info{Major:"1", Minor:"19", GitVersion:"v1.19.0+359dd79", GitCommit:"359dd790a64aa35b626a6a081abddd7db9e2dd37", GitTreeState:"clean", BuildDate:"2020-09-24T13:29:40Z", GoVersion:"go1.15.0", Compiler:"gc", Platform:"linux/amd64"}
    
  • Tekton Pipeline version:

    Output of tkn version or kubectl get pods -n tekton-pipelines -l app=tekton-pipelines-controller -o=jsonpath='{.items[0].metadata.labels.version}'

    $ tkn version
    Client version: 0.13.0
    Pipeline version: v0.16.3
    Triggers version: v0.8.1
    
    
  • Operating System:

    All
    

Expected Behavior

The taskrun/pipelinerun should start and completed successfully

Actual Behavior

The taskrun/pipelinerun status is getting set to Cancelled

Steps to Reproduce the Problem

  1. Create a task/pipeline
  2. Start the task/pipeline and cancel the taskrun/pipelinerun
  3. Start the taskrun/pipelinerun with command using --use-taskrun/--use-pipelinerun and provide name of cancelled taskrun/pipelinerun

Additional Info

Note: tkn t/p start task-name/pipeline-name -L causes the same problem if the last taskrun/pipelinerun status is cancelled
Command execution logs:

$ tkn tr ls
No TaskRuns found
$ 
$ tkn t start wait-task
? Value for param `test-param` of type `string`? check
TaskRun started: wait-task-run-gjd2c

In order to track the TaskRun progress run:
tkn taskrun logs wait-task-run-gjd2c -f -n veeresh-user1
$ 
$ 
$ tkn tr ls
NAME                  STARTED          DURATION   STATUS
wait-task-run-gjd2c   16 seconds ago   ---        Running
$ 
$ tkn tr cancel wait-task-run-gjd2c
TaskRun cancelled: wait-task-run-gjd2c
$ 
$ tkn tr ls
NAME                  STARTED          DURATION     STATUS
wait-task-run-gjd2c   36 seconds ago   28 seconds   Cancelled(TaskRunCancelled)
$ 
$ 
$ tkn t start wait-task --use-taskrun wait-task-run-gjd2c
TaskRun started: wait-task-run-rn285

In order to track the TaskRun progress run:
tkn taskrun logs wait-task-run-rn285 -f -n veeresh-user1
$ 
$ 
$ tkn tr ls
NAME                  STARTED         DURATION     STATUS
wait-task-run-rn285   9 seconds ago   0 seconds    Cancelled(TaskRunCancelled)
wait-task-run-gjd2c   1 minute ago    28 seconds   Cancelled(TaskRunCancelled)
$ 
$ tkn pr ls
No PipelineRuns found
$ 
$ 
$ tkn p start test-cancel-pipeline
? Value for param `test-param-pipeline` of type `string`? check-pipeline
PipelineRun started: test-cancel-pipeline-run-x4j99

In order to track the PipelineRun progress run:
tkn pipelinerun logs test-cancel-pipeline-run-x4j99 -f -n veeresh-user1
$ 
$ tkn pr ls
NAME                             STARTED         DURATION   STATUS
test-cancel-pipeline-run-x4j99   9 seconds ago   ---        Running
$ 
$ 
$ tkn pr cancel test-cancel-pipeline-run-x4j99
PipelineRun cancelled: test-cancel-pipeline-run-x4j99
$ 
$
$ tkn p start test-cancel-pipeline --use-pipelinerun test-cancel-pipeline-run-x4j99
PipelineRun started: test-cancel-pipeline-run-c7r5g

In order to track the PipelineRun progress run:
tkn pipelinerun logs test-cancel-pipeline-run-c7r5g -f -n veeresh-user1
$ 
$ 
$ tkn pr ls
NAME                             STARTED         DURATION     STATUS
test-cancel-pipeline-run-c7r5g   9 seconds ago   0 seconds    Cancelled(PipelineRunCancelled)
test-cancel-pipeline-run-x4j99   1 minute ago    23 seconds   Cancelled(PipelineRunCancelled)

Metadata

Metadata

Assignees

Labels

kind/bugCategorizes issue or PR as related to a bug.

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions