pipeline: Finally tasks not triggered in case of task failing due to missing results

Expected Behavior

I have a pipeline with two tasks - first one producing a result, second one using the result and finally task not using the result at all. Finally task should always run.

Actual Behavior

When first task doesn’t produce the result, second one correctly fails. Finally task is skipped.

Steps to Reproduce the Problem

  1. Run the below pipeline
apiVersion: tekton.dev/v1beta1
kind: Pipeline
metadata:
  name: finally-pipeline
spec:
  tasks:
  - name: task-a
    taskSpec:
      steps:
      - name: hello
        image: registry.access.redhat.com/ubi8/ubi-minimal
        script: |
          #!/usr/bin/env bash
          echo "Hello from task A"
          # uncomment to fix the issue
          #echo "foo" > $(results.foo.path)
          sleep 5
      results:
        - name: foo
  - name: task-b
    params:
      - name: input
        value: $(tasks.task-a.results.foo)
    taskSpec:
      params:
        - name: input
      steps:
      - name: hello
        image: registry.access.redhat.com/ubi8/ubi-minimal
        script: |
          #!/usr/bin/env bash
          echo "Hello from task B"
          echo "Content of param: $(params.input)"
          sleep 5
  finally:
  - name: final-task
    taskSpec:
      steps:
      - name: finally
        image: registry.access.redhat.com/ubi8/ubi-minimal
        script: |
          #!/usr/bin/env bash
          echo "Hello from finally"
          sleep 5

Additional Info

  • Kubernetes version:

    Output of kubectl version:

Client Version: version.Info{Major:"1", Minor:"26", GitVersion:"v1.26.9", GitCommit:"d1483fdf7a0578c83523bc1e2212a606a44fd71d", GitTreeState:"archive", BuildDate:"2023-09-16T00:00:00Z", GoVersion:"go1.20.8", Compiler:"gc", Platform:"linux/amd64"}
Kustomize Version: v4.5.7
Server Version: version.Info{Major:"1", Minor:"26", GitVersion:"v1.26.9+636f2be", GitCommit:"e782f8ba0e57d260867ea108b671c94844780ef2", GitTreeState:"clean", BuildDate:"2023-10-20T19:28:29Z", GoVersion:"go1.19.13 X:strictfipsruntime", Compiler:"gc", Platform:"linux/arm64"}
  • 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}'

Client version: 0.32.2
Chains version: v0.17.1
Pipeline version: v0.50.3
Triggers version: v0.25.2
Operator version: v0.68.1

Similar to https://github.com/tektoncd/pipeline/issues/4438

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 19 (17 by maintainers)

Most upvoted comments

/assign I will work on this

Thanks! Just come back from holidays, will work on this issue

@Yongxuanzhang any updates?

Sorry I’m kinda busy recently, 😢 , don’t have enough time to come up with a solution yet.