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

InvalidTaskResultsReference when dynamically generating subsequent tasks in a pipeline using matrix #8324

Open
jjsiv opened this issue Oct 10, 2024 · 3 comments · May be fixed by #8487
Open
Labels
kind/bug Categorizes issue or PR as related to a bug.

Comments

@jjsiv
Copy link

jjsiv commented Oct 10, 2024

Expected Behavior

Pipeline runs and taskruns from all 3 tasks are generated.

Actual Behavior

PipelineRun fails with 'invalid result reference in pipeline task "printer": unable to validate result referencing pipeline task "platforms": task spec not found'

Steps to Reproduce the Problem

Run a pipeline with 3 tasks:

  • first task generates an array type result
  • second task references the array type result generated from the first task to dynamically generate taskruns using matrix. Each of these runs then sets a string type result
  • third task references the aggregated results of taskruns from the second task to dynamically fan out tasks once again using matrix, as described in the documentation here. This will fail with the following error: 'invalid result reference in pipeline task "printer": unable to validate result referencing pipeline task "platforms": task spec not found'
apiVersion: tekton.dev/v1
kind: Task
metadata:
  name: array-emitter
spec:
  results:
  - name: array
    type: array
  steps:
    - name: echo
      image: mirror.gcr.io/alpine
      script: |
        echo -n "[\"linux\",\"max\",\"windows\"]" > $(results.array.path)
---
apiVersion: tekton.dev/v1
kind: Task
metadata:
  name: platform-browsers
spec:
  params:
    - name: platform
    - name: testmatrixed
  results:
  - name: str
    type: string
  steps:
    - name: echo
      image: mirror.gcr.io/alpine
      script: |
        echo "$(params.platform)"
        echo -n "PARAM" > $(results.str.path)
---
apiVersion: tekton.dev/v1
kind: Task
metadata:
  name: printer
spec:
  params:
    - name: test
  steps:
    - name: echo
      image: mirror.gcr.io/alpine
      script: |
        echo $(params.test)
---
apiVersion: tekton.dev/v1
kind: PipelineRun
metadata:
  name: matrixed-pr
spec:
  taskRunTemplate:
    serviceAccountName: "default"
  pipelineSpec:
    tasks:

    - name: array-emitter
      taskRef:
        name: array-emitter

    - name: platforms
      params:
        - name: test
          value: test
      matrix:
        params:
          - name: platform
            value: $(tasks.array-emitter.results.array[*])
      taskRef:
        name: platform-browsers

    - name: printer
      taskRef:
        name: printer
      matrix:
        params:
          - name: platform
            value: $(tasks.platforms.results.str[*])

Additional Info

  • Kubernetes version:

    Output of kubectl version:

Client Version: v1.31.1
Kustomize Version: v5.4.2
Server Version: v1.31.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}'

v0.64.0
@jjsiv jjsiv added the kind/bug Categorizes issue or PR as related to a bug. label Oct 10, 2024
@fabricebrito
Copy link

+1

@chengjoey
Copy link
Member

/assign @l-qing

@l-qing will go head

hi @l-qing , please submit a new pr

@tekton-robot
Copy link
Collaborator

@chengjoey: GitHub didn't allow me to assign the following users: l-qing.

Note that only tektoncd members, repo collaborators and people who have commented on this issue/PR can be assigned. Additionally, issues/PRs can only have 10 assignees at the same time.
For more information please see the contributor guide

In response to this:

/assign @l-qing

@l-qing will go head

hi @l-qing , please submit a new pr

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

l-qing added a commit to l-qing/pipeline that referenced this issue Jan 14, 2025
@l-qing l-qing linked a pull request Jan 14, 2025 that will close this issue
8 tasks
l-qing added a commit to l-qing/pipeline that referenced this issue Jan 15, 2025
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
4 participants