pipeline
pipeline copied to clipboard
matrixed `PipelineRun` status conditions should include the all the taskruns count
Expected Behavior
Matrixed Pipelinerun
status condition message to include all the TaskRuns
count produced by the PipelineRun
conditions:
- lastTransitionTime: '2023-11-15T09:34:54Z'
message: 'Tasks Completed: 12 (Failed: 0, Cancelled 0), Skipped: 0'
reason: Succeeded
status: 'True'
type: Succeeded
Actual Behavior
Pipelinerun status condition message count only includes the tasks from the spec.pipelineSpec.tasks
conditions:
- lastTransitionTime: '2023-11-15T09:34:54Z'
message: 'Tasks Completed: 3 (Failed: 0, Cancelled 0), Skipped: 0'
reason: Succeeded
status: 'True'
type: Succeeded
Steps to Reproduce the Problem
apiVersion: tekton.dev/v1
kind: Task
metadata:
name: platform-browsers
annotations:
description: |
A task that does something cool with platforms and browsers
spec:
params:
- name: platform
- name: browser
- name: url
steps:
- name: echo
image: alpine
script: |
echo "Visit $(params.url) on $(params.platform) using $(params.browser)."
---
apiVersion: tekton.dev/v1
kind: PipelineRun
metadata:
generateName: matrixed-pr-
spec:
taskRunTemplate:
serviceAccountName: "default"
pipelineSpec:
tasks:
- name: get-platforms
taskSpec:
results:
- name: platforms
type: array
steps:
- name: produce-a-list-of-platforms
image: bash:latest
script: |
#!/usr/bin/env bash
echo -n "[\"linux\",\"mac\",\"windows\"]" | tee $(results.platforms.path)
- name: get-browsers-and-url
taskSpec:
results:
- name: browsers
type: array
- name: url
steps:
- name: produce-a-list-of-browsers
image: bash:latest
script: |
#!/usr/bin/env bash
echo -n "[\"chrome\",\"safari\",\"firefox\"]" | tee $(results.browsers.path)
- name: produce-url
image: bash:latest
script: |
#!/usr/bin/env bash
echo -n "myfavoritesitedotcom" | tee $(results.url.path)
- name: platforms-and-browsers-dag
matrix:
params:
- name: platform
value: $(tasks.get-platforms.results.platforms[*])
- name: browser
value:
- $(tasks.get-browsers-and-url.results.browsers[0])
- $(tasks.get-browsers-and-url.results.browsers[2])
- name: url
value:
- $(tasks.get-browsers-and-url.results.url)
taskRef:
name: platform-browsers
- Create the task and Pipelinerun
- Check the status.conditions[0].message
Additional Info
-
Kubernetes version:
Output of
kubectl version
:
Server Version: version.Info{Major:"1", Minor:"27", GitVersion:"v1.27.3+ab0b8ee", GitCommit:"ee9c1a1f13b06f5e2a79dcbd06285ec3f8315448", GitTreeState:"clean", BuildDate:"2023-06-27T15:55:01Z", GoVersion:"go1.20.3", Compiler:"gc", Platform:"linux/amd64"}
-
Tekton Pipeline version:
Output of
tkn version
orkubectl get pods -n tekton-pipelines -l app=tekton-pipelines-controller -o=jsonpath='{.items[0].metadata.labels.version}'
v0.50.3
/cc @vdemeester
/assign