Updating PipelineRun params is not declarative
Expected Behavior
When PipelineRun params are updated, the PipelineRuns .spec is updated, and the PipelineRun is re-run, creating new TaskRuns and pods, and finally the .status is updated.
OR
The PipelineRun .spec (or at least params) are immutable, because once created the parameters cannot be reconciled
Actual Behavior
The PipelineRuns .spec is updated, but never reconciled and re-run. The PipelineRun .status remains with details of the PipelineRun run using the old parameters.
Steps to Reproduce the Problem
- kubectl apply -f
apiVersion: tekton.dev/v1
kind: PipelineRun
metadata:
name: my-plr
spec:
pipelineSpec:
tasks:
- name: foo
params:
- name: IMAGE
value: xxx
taskSpec:
steps:
- name: test
image: ubuntu
command: ["/bin/bash"]
args:
- -c
- |
set -e
set -x
echo hello $(params.IMAGE)
- Edit above spec to change value of
IMAGE - kubectl apply -f
Additional Info
-
Kubernetes version:
Output of
kubectl version:
Client Version: v1.29.4
Kustomize Version: v5.0.4-0.20230601165947-6ce0bf390ce3
Server Version: v1.27.4
- Tekton Pipeline version:
v0.53.0
Thanks @jimmyjones2 - a PipelineRuns cannot be "re-run" - PipelineRuns are by design associated one-by-one with executions of pipelines.
We could prevent updates to the spec in *Run resources though - I believe it should be doable via the validating webhook. @tektoncd/core-maintainers WDYT?
We could prevent updates to the spec in
*Runresources though - I believe it should be doable via the validating webhook. @tektoncd/core-maintainers WDYT?
Yes, we could definitely do that 👍🏼
This issue may be fixed in this PR:
- https://github.com/tektoncd/pipeline/pull/8149