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

Cannot refer to some parameters from expression template #6909

Closed
nomeaning777 opened this issue Oct 12, 2021 · 1 comment · Fixed by #6921
Closed

Cannot refer to some parameters from expression template #6909

nomeaning777 opened this issue Oct 12, 2021 · 1 comment · Fixed by #6921
Labels
good first issue Good for newcomers type/bug type/regression Regression from previous behavior (a specific type of bug)

Comments

@nomeaning777
Copy link

Summary

What happened/what you expected to happen?

If PARAMETER-NAME is a prefix of another parameter, {{=inputs.parameters.PARAMETER-NAME}} will fail to resolve.
This is probably due to Expand function in util/expand/expand.go.

What version is it broken in?
v3.1.13

What version was it working in?
v3.1.12

Diagnostics

kind: Workflow
metadata:
  generateName: parameter-expand-
  annotations:
    workflows.argoproj.io/version: ">= 3.1.0"
spec:
  entrypoint: main
  templates:
    - name: main
      inputs:
        parameters:
          - name: a
            value: A
          - name: a2
            value: A2
      script:
        env:
          - name: A
            value: "{{=inputs.parameters.a}}"
          - name: A2
            value: "{{=inputs.parameters.a2}}"
        image: debian:9.4
        command: [bash]
        source: |
          echo "$A / $A2"

Workflow stdout of v3.1.13

{{=inputs.parameters.a}} / A2

Workflow stdout of v3.1.12

A / A2

What Kubernetes provider are you using? GKE v1.20

What executor are you running? Emissary


Message from the maintainers:

Impacted by this bug? Give it a 👍. We prioritise the issues with the most 👍.

@nomeaning777 nomeaning777 added type/bug type/regression Regression from previous behavior (a specific type of bug) triage labels Oct 12, 2021
@alexec
Copy link
Contributor

alexec commented Oct 12, 2021

This is the cause:

if strings.HasPrefix(keys[i+1]+".", k) {

This should probably be:

if strings.HasPrefix(keys[i+1], k+".") {

Should be easy to fix, would you like to submit a fix?

@alexec alexec added the good first issue Good for newcomers label Oct 12, 2021
alexec added a commit that referenced this issue Oct 12, 2021
Signed-off-by: Alex Collins <alex_collins@intuit.com>
alexec added a commit that referenced this issue Oct 14, 2021
Signed-off-by: Alex Collins <alex_collins@intuit.com>
This was referenced Oct 15, 2021
sarabala1979 pushed a commit that referenced this issue Oct 19, 2021
Signed-off-by: Alex Collins <alex_collins@intuit.com>
sarabala1979 pushed a commit that referenced this issue Oct 20, 2021
Signed-off-by: Alex Collins <alex_collins@intuit.com>
basanthjenuhb pushed a commit to basanthjenuhb/argo-workflows that referenced this issue Oct 23, 2021
…j#6921)

Signed-off-by: Alex Collins <alex_collins@intuit.com>
Signed-off-by: bjenuhb <basanth_jenuhb@intuit.com>
kriti-sc pushed a commit to kriti-sc/argo-workflows that referenced this issue Oct 24, 2021
…j#6921)

Signed-off-by: Alex Collins <alex_collins@intuit.com>
Signed-off-by: kriti-sc <kathuriakriti1@gmail.com>
@alexec alexec mentioned this issue Nov 5, 2021
25 tasks
ilyagorban-codefresh added a commit to codefresh-io/argo-workflows that referenced this issue Nov 10, 2021
* fix: do not delete expr tag tmpl values. Fixes argoproj#6909 (argoproj#6921)

Signed-off-by: Alex Collins <alex_collins@intuit.com>

* update image registry

* result of `make pre-commit -B`

* Retrigger CI pipeline

* result of `make codegen -B STATIC_FILES=false`

Co-authored-by: Alex Collins <alexec@users.noreply.github.com>
Co-authored-by: Ilya Gorban <ilyagorban@Ilyas-MacBook-Pro.local>
@sarabala1979 sarabala1979 mentioned this issue Dec 15, 2021
73 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers type/bug type/regression Regression from previous behavior (a specific type of bug)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants