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

Params in multiple Condition of one task will overwrite by the last one #1619

Closed
vincent-pli opened this issue Nov 26, 2019 · 1 comment
Closed
Labels
kind/bug Categorizes issue or PR as related to a bug.

Comments

@vincent-pli
Copy link
Member

I have a Pipeline defined with multiple Conditions in one Task like this:

apiVersion: tekton.dev/v1alpha1
kind: Pipeline
metadata:
  name: list-files-pipeline
spec:
  resources:
    - name: source-repo
      type: git
  params:
    - name: path
      default: "README.md"
    - name: test-path
      default: "README.mdxxx"
    - name: image
      default: "alpine"
  tasks:
    - name: list-files-1
      taskRef:
        name: list-files
      conditions:
        - conditionRef: "file-exists"
          params:
            - name: path
              value: "$(params.path)"
            - name: image
              value: "$(params.image)"
          resources:
            - name: workspace
              resource: source-repo
        - conditionRef: "file-exists"
          params:
            - name: path
              value: "$(params.test-path)"
            - name: image
              value: "$(params.image)"
          resources:
            - name: workspace
              resource: source-repo

I expect the first condition which check "README.md" will be success and the second one for "README.mdxxx" will failed, but all of them are failed.

I checked the Taskruns generated, found inputs.params is all about "README.mdxxx"
like this:

spec:
  inputs:
    params:
    - name: path
      value: README.mdxxx

Expected Behavior

The first condition for "README.md" will success,
The second one for "README.mdxxx" will failed

Actual Behavior

All the two generated Taskrun are failed.

Additional Info

@vdemeester
Copy link
Member

/cc @dibyom
/kind bug

@tekton-robot tekton-robot added the kind/bug Categorizes issue or PR as related to a bug. label Nov 26, 2019
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