Uploaded image for project: 'OpenShift Pipelines'
  1. OpenShift Pipelines
  2. SRVKP-2975

`tkn tr delete --keep <n>` does not work when pipelineruns are present

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Blocker Blocker
    • Pipelines 1.10.0
    • None
    • Tekton CLI
    • None
    • 1
    • False
    • None
    • False
    • This will fix tkn tr delete --keep command
    • Pipelines Sprint 235

      Description of problem:

      `tkn tr delete --keep <n>` is not working when taskruns belonging to pipelineruns are present

      Prerequisites (if any, like setup, operators/versions):

      Steps to Reproduce

      1. Create few taskruns and create few pipelineruns
      2. Wait for the pipelinerun and taskrun to get completed
      3. Run tkn tr delete --keep 2

      Actual results:

      Taskruns which are related to pipelineruns are not getting deleted

      Expected results:

      tkn command should delete all taskruns except 2

      Reproducibility (Always/Intermittent/Only Once):

      Always

      Build Details:

      https://artifacts.ospqa.com/builds/1.10.0/469138-4.11/ 

       

      Client version: 0.30.0
      Pipeline version: v0.44.0
      Triggers version: v0.23.0
      Operator version: v0.65.1 

       

       

      Additional info (Such as Logs, Screenshots, etc):

      tkn tr ls                                                           
      NAME                                STARTED         DURATION   STATUS
      echo-pipeline-run-jhvrn-echo-task   3 minutes ago   7s         Succeeded
      echo-task-run-ddb9v                 3 minutes ago   7s         Succeeded
      echo-task-run-xwfk4                 3 minutes ago   7s         Succeeded
      
      tkn tr delete --keep 2                                              
      Are you sure you want to delete all TaskRuns in namespace "releasetest-w7vw7" keeping 2 TaskRuns (y/n): y
      All but 2 TaskRuns(Completed) deleted in namespace "releasetest-w7vw7"
      
      tkn tr ls                                                      
      NAME                                STARTED         DURATION   STATUS
      echo-pipeline-run-jhvrn-echo-task   3 minutes ago   7s         Succeeded
      echo-task-run-ddb9v                 3 minutes ago   7s         Succeeded
      echo-task-run-xwfk4                 3 minutes ago   7s         Succeeded 

              shverma Shiv Verma
              varadhya Veeresh Aradhya (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: