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

PipelineRun emitting task results that were never produced #3465

Closed
Fabian-K opened this issue Oct 28, 2020 · 1 comment · Fixed by #3472
Closed

PipelineRun emitting task results that were never produced #3465

Fabian-K opened this issue Oct 28, 2020 · 1 comment · Fixed by #3472
Labels
kind/bug Categorizes issue or PR as related to a bug.

Comments

@Fabian-K
Copy link
Contributor

Hi,

we have a task that emits a result and a pipeline that propagates the task result using (https://github.com/tektoncd/pipeline/blob/master/docs/pipelines.md#emitting-results-from-a-pipeline). In case the task failed, the PipelineRun contains the pipelineResult with the template string as a value, in this example $(tasks.print-date.results.current-date-unix-timestamp)

apiVersion: tekton.dev/v1beta1
kind: PipelineRun
metadata:
  name: test-run
  namespace: default
spec:
  pipelineRef:
    name: simple-pipeline
  serviceAccountName: default
  timeout: 1h0m0s
status:
  completionTime: "2020-10-28T14:48:57Z"
  conditions:
    - lastTransitionTime: "2020-10-28T14:48:57Z"
      message: 'Tasks Completed: 1 (Failed: 1, Cancelled 0), Skipped: 0'
      reason: Failed
      status: "False"
      type: Succeeded
  pipelineResults:
    - name: current-date-unix-timestamp
      value: $(tasks.print-date.results.current-date-unix-timestamp)
  pipelineSpec:
    <...>

IMO this is unexpected as this could be interpreted as the actual value (but i guess this is open for discussion). It however is for sure not consistent with the behavior of the task run which for this case does not include the result at all.

apiVersion: tekton.dev/v1beta1
kind: TaskRun
metadata:
  name: test-run-print-date-t55td
  namespace: default
spec:
  resources: {}
  serviceAccountName: default
  taskRef:
    kind: Task
    name: print-date
  timeout: 1h0m0s
status:
  completionTime: "2020-10-28T14:48:57Z"
  conditions:
    - lastTransitionTime: "2020-10-28T14:48:57Z"
      message: |
        "step-print-date-unix-timestamp" exited with code 1 (image: "docker.io/library/bash@sha256:01fad26fa8ba21bce6e8c47222acfdb54649957f1e86d53a0c8e03360271abf6"); for logs run: kubectl -n default logs test-run-print-date-t55td-pod-8xwbp -c step-print-date-unix-timestamp
      reason: Failed
      status: "False"
      type: Succeeded
  podName: test-run-print-date-t55td-pod-8xwbp
  startTime: "2020-10-28T14:48:51Z"
  steps:
    - container: step-print-date-unix-timestamp
      imageID: docker.io/library/bash@sha256:01fad26fa8ba21bce6e8c47222acfdb54649957f1e86d53a0c8e03360271abf6
      name: print-date-unix-timestamp
      terminated:
        containerID: containerd://e92b294e99c21cb45ebefc0ecedda2347191c98e604a1f734d8017837c33733e
        exitCode: 1
        finishedAt: "2020-10-28T14:48:56Z"
        reason: Error
        startedAt: "2020-10-28T14:48:56Z"
  taskSpec:
    <...>

What do you think about this?

Here is the pipeline and task definition that i used:

apiVersion: tekton.dev/v1beta1
kind: Task
metadata:
  name: print-date
  namespace: default
spec:
  results:
    - name: current-date-unix-timestamp
      description: The current date in unix timestamp format
  steps:
    - name: print-date-unix-timestamp
      image: bash:latest
      script: |
        #!/usr/bin/env bash
        # intentionally fail the task
        exit 1
---
apiVersion: tekton.dev/v1beta1
kind: Pipeline
metadata:
  name: simple-pipeline
  namespace: default
spec:
  results:
    - name: current-date-unix-timestamp
      value: $(tasks.print-date.results.current-date-unix-timestamp)
  tasks:
    - name: print-date
      taskRef:
        name: print-date
@ghost
Copy link

ghost commented Oct 28, 2020

Yeah I agree, this should be viewed as a bug and behaviour should match that of TaskRuns. We haven't specified the scenario in our docs when a failure occurs so I think we should go ahead and make the behaviour match between PipelineRun <-> TaskRun.

/kind bug

@tekton-robot tekton-robot added the kind/bug Categorizes issue or PR as related to a bug. label Oct 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants