pipeline icon indicating copy to clipboard operation
pipeline copied to clipboard

Updating PipelineRun params is not declarative

Open jimmyjones2 opened this issue 1 year ago • 2 comments

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

  1. 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)
  1. Edit above spec to change value of IMAGE
  2. 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

jimmyjones2 avatar May 20 '24 12:05 jimmyjones2

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?

afrittoli avatar May 20 '24 12:05 afrittoli

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?

Yes, we could definitely do that 👍🏼

vdemeester avatar May 21 '24 10:05 vdemeester

This issue may be fixed in this PR:

  • https://github.com/tektoncd/pipeline/pull/8149

l-qing avatar Jul 27 '24 03:07 l-qing