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

Task results variable substitution is broken #7852

Open
tomalexander opened this issue Apr 7, 2024 · 1 comment
Open

Task results variable substitution is broken #7852

tomalexander opened this issue Apr 7, 2024 · 1 comment
Labels
kind/bug Categorizes issue or PR as related to a bug.

Comments

@tomalexander
Copy link

Expected Behavior

The "echo-variable" task in the example PipelineRun should print to stdout "The variable: dolar"

Actual Behavior

The "echo-variable" task in the example PipelineRun prints:

2024-04-07T01:25:23.656135143Z /tekton/scripts/script-0-8b297: line 2: tasks.set-variable.results.ipsum: not found
2024-04-07T01:25:23.656332139Z The variable: 

Steps to Reproduce the Problem

Broken:

Install the tekton operator helm chart from this commit: tektoncd/operator@7bc7f7e

(note: that is just the latest commit, I am not blaming that commit specifically)

Then kubectl apply this PipelineRun: (note, you may need to change the namespace based on your tekton setup)

apiVersion: tekton.dev/v1beta1
kind: PipelineRun
metadata:
  name: minimal-test
  namespace: lighthouse
spec:
  pipelineSpec:
    tasks:
      - name: echo-variable
        taskSpec:
          metadata: {}
          stepTemplate:
            image: alpine:3.18
            name: ""
            resources:
              requests:
                cpu: 10m
                memory: 600Mi
          steps:
            - image: alpine:3.18
              script: |
                #!/usr/bin/env sh
                echo "The variable: $(params.LOREM)"
        params:
          - name: LOREM
            value: $(tasks.set-variable.results.ipsum)
      - name: set-variable
        taskSpec:
          metadata: {}
          stepTemplate:
            image: alpine:3.18
            name: ""
            resources:
              requests:
                cpu: 10m
                memory: 600Mi
          results:
            - name: ipsum
          steps:
            - image: alpine:3.18
              script: |
                #!/usr/bin/env sh
                echo -n "dolar" > "$(results.ipsum.path)"
  timeout: 240h0m0s

Look at the output for the "echo-variable" step and see the error.

Working:

Do the exact same steps, except when installing tekton, install from this tag: https://github.com/tektoncd/operator/tree/tekton-operator-0.67.0

Additional Info

  • Kubernetes version:

    Output of kubectl version:

Client Version: v1.29.3
Kustomize Version: v5.0.4-0.20230601165947-6ce0bf390ce3
Server Version: v1.27.2
WARNING: version difference between client (1.29) and server (1.27) exceeds the supported minor version skew of +/-1
  • 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}'

Broken

v0.50.1

Working

v0.47.0
@tomalexander tomalexander added the kind/bug Categorizes issue or PR as related to a bug. label Apr 7, 2024
@l-qing
Copy link
Contributor

l-qing commented Apr 16, 2024

I see this issue can no longer be reproduced on the latest v0.58.
Maybe you can try updating to the latest version and see if that helps?

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

No branches or pull requests

2 participants