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

Regression on parameter inputs when switching pipelinerun spec's task order #7155

Closed
Tomcli opened this issue Sep 26, 2023 · 5 comments
Closed
Labels
kind/bug Categorizes issue or PR as related to a bug.

Comments

@Tomcli
Copy link
Contributor

Tomcli commented Sep 26, 2023

Expected Behavior

Using the example pipelinerun-results-with-params. When I switched the pipelinerun's task order like below, the "first" task no longer can populate the parameters from any task results.

apiVersion: tekton.dev/v1
kind: PipelineRun
metadata:
  generateName: test-case-
spec:
  params:
  - name: prefix
    value: prefix
  pipelineSpec:
    params:
    - name: prefix
    tasks:
    - name: do-something
      taskSpec:
        params:
        - name: arg
        steps:
        - name: do-something
          image: alpine
          script: |
            echo "$(params.arg)" | grep "prefix:suffix"
      params:
      - name: arg
        value: "$(params.prefix):$(tasks.generate-suffix.results.suffix)"
    - name: generate-suffix
      taskSpec:
        results:
        - name: suffix
        steps:
        - name: generate-suffix
          image: alpine
          script: |
            echo -n "suffix" > $(results.suffix.path)

On Tekton 0.47, this was working as expected. From Tekton 0.50+, this new regression issue happened.

Actual Behavior

Tekton won't able to populate the parameters from other task results when creating the taskrun.

apiVersion: tekton.dev/v1
kind: TaskRun
metadata:
  annotations:
    pipeline.tekton.dev/release: feb943c
  creationTimestamp: "2023-09-26T20:01:39Z"
  generation: 1
  labels:
    app.kubernetes.io/managed-by: tekton-pipelines
    tekton.dev/memberOf: tasks
    tekton.dev/pipeline: test-case-sxngt
    tekton.dev/pipelineRun: test-case-sxngt
    tekton.dev/pipelineTask: do-something
  name: test-case-sxngt-do-something
  namespace: default
  ownerReferences:
  - apiVersion: tekton.dev/v1
    blockOwnerDeletion: true
    controller: true
    kind: PipelineRun
    name: test-case-sxngt
    uid: c9706b50-bc9f-41c8-aebe-a00ca1165aa6
  resourceVersion: "155220"
  uid: 088daaa6-40a6-4bcf-959c-5d3cc3e7d52c
spec:
  params:
  - name: arg
    value: prefix:$(tasks.generate-suffix.results.suffix)
  serviceAccountName: default
  taskSpec:
    params:
    - name: arg
      type: string
    steps:
    - computeResources: {}
      image: alpine
      name: do-something
      script: |
        echo "$(params.arg)" | grep "prefix:suffix"
  timeout: 1h0m0s
status:
  completionTime: "2023-09-26T20:01:50Z"
  conditions:
  - lastTransitionTime: "2023-09-26T20:01:50Z"
    message: |
      "step-do-something" exited with code 1 (image: "docker.io/library/alpine@sha256:7144f7bab3d4c2648d7e59409f15ec52a18006a128c733fcff20d3a4a54ba44a"); for logs run: kubectl -n default logs test-case-sxngt-do-something-pod -c step-do-something
    reason: Failed
    status: "False"
    type: Succeeded
  podName: test-case-sxngt-do-something-pod
  provenance:
    featureFlags:
      AwaitSidecarReadiness: true
      Coschedule: workspaces
      DisableAffinityAssistant: false
      DisableCredsInit: false
      EnableAPIFields: beta
      EnableProvenanceInStatus: true
      EnableTektonOCIBundles: false
      EnforceNonfalsifiability: none
      MaxResultSize: 4096
      RequireGitSSHSecretKnownHosts: false
      ResultExtractionMethod: termination-message
      RunningInEnvWithInjectedSidecars: true
      ScopeWhenExpressionsToTask: false
      SendCloudEventsForRuns: false
      SetSecurityContext: false
      VerificationNoMatchPolicy: ignore
  startTime: "2023-09-26T20:01:39Z"
  steps:
  - container: step-do-something
    imageID: docker.io/library/alpine@sha256:7144f7bab3d4c2648d7e59409f15ec52a18006a128c733fcff20d3a4a54ba44a
    name: do-something
    terminated:
      containerID: containerd://15418dca6dcbbd1bc55be149fe223c243ea44bbe90c38f2637f03837498e55b9
      exitCode: 1
      finishedAt: "2023-09-26T20:01:49Z"
      reason: Error
      startedAt: "2023-09-26T20:01:49Z"
  taskSpec:
    params:
    - name: arg
      type: string
    steps:
    - computeResources: {}
      image: alpine
      name: do-something
      script: |
        echo "prefix:$(tasks.generate-suffix.results.suffix)" | grep "prefix:suffix"

Steps to Reproduce the Problem

  1. Run this example
apiVersion: tekton.dev/v1
kind: PipelineRun
metadata:
  generateName: test-case-
spec:
  params:
  - name: prefix
    value: prefix
  pipelineSpec:
    params:
    - name: prefix
    tasks:
    - name: do-something
      taskSpec:
        params:
        - name: arg
        steps:
        - name: do-something
          image: alpine
          script: |
            echo "$(params.arg)" | grep "prefix:suffix"
      params:
      - name: arg
        value: "$(params.prefix):$(tasks.generate-suffix.results.suffix)"
    - name: generate-suffix
      taskSpec:
        results:
        - name: suffix
        steps:
        - name: generate-suffix
          image: alpine
          script: |
            echo -n "suffix" > $(results.suffix.path)
  1. Taskrun parameters with tasks.<taskName>.results.<resultName> won't get populated

Additional Info

  • Kubernetes version: 1.27

    Output of kubectl version:

Server Version: version.Info{Major:"1", Minor:"27", GitVersion:"v1.27.5+IKS", GitCommit:"0adc6c6dcc2bba892cb461d4201b176ed84a13fe", GitTreeState:"clean", BuildDate:"2023-09-01T06:35:46Z", GoVersion:"go1.20.7", Compiler:"gc", Platform:"linux/amd64"}
  • Tekton Pipeline version: 0.50.1 and 0.52.0

    Output of tkn version or kubectl get pods -n tekton-pipelines -l app=tekton-pipelines-controller -o=jsonpath='{.items[0].metadata.labels.version}'

v0.52.0
@Tomcli Tomcli added the kind/bug Categorizes issue or PR as related to a bug. label Sep 26, 2023
@Tomcli
Copy link
Contributor Author

Tomcli commented Sep 26, 2023

/cc @afrittoli

@vdemeester
Copy link
Member

I think it's the same issue as #7103, isn't it ?

@Tomcli
Copy link
Contributor Author

Tomcli commented Sep 27, 2023

I think it's the same issue as #7103, isn't it ?

Yes, I can update my details at #7103 since this also happened in the LTS version 0.50.1.

@Tomcli
Copy link
Contributor Author

Tomcli commented Oct 3, 2023

fixed by #7169
/close

@tekton-robot
Copy link
Collaborator

@Tomcli: Closing this issue.

In response to this:

fixed by #7169
/close

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.

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

3 participants