Argo: Argo CLI: String parameters submitted in parameter-file have extraneous double quotes added

Created on 26 Dec 2019  路  3Comments  路  Source: argoproj/argo

Checklist:

  • [x] I've included the version.
  • [x] I've included reproduction steps.
  • [x] I've included the workflow YAML.
  • [ ] I've included the logs.

What happened:

When creating a workflow and using a parameter-file, argocli adds double quotes to all strings. This causes problems with annotations, labels, etc.

What you expected to happen:
Strings should not have double quotes.

How to reproduce it (as minimally and precisely as possible):

  1. Create workflow and parameter file
 # bad_string_parameter_interpolation.yaml
apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
  generateName: extra-double-quotes
spec:
  entrypoint: echo-string
  arguments:
    parameters:
      - name: some-string-variable

  templates:
    - name: echo-string
      metadata:
        annotations:
          fake-annotiation: "{{workflow.parameters.some-string-variable}}"
      script:
        image: debian:buster
        command: [bash]
        source: |
          echo {{workflow.parameters.some-string-variable}}
# test-string-interpolation_params.yaml
---
some-string-variable: bar
  1. Submit Workflow with file parameter
$ argo submit bad_string_parameter_interpolation.yaml -n argo -f test-string-interpolation_params.yaml
Name:                extra-double-quotesbtqp6
Namespace:           default
ServiceAccount:      default
Status:              Pending
Created:             Thu Dec 26 12:00:40 -0500 (now)
Parameters:
  some-string-variable: "bar"
  1. Get the pod description to check the annotiation:
$ kubectl -n argo get pod extra-double-quotesbtqp6 -o yaml
apiVersion: v1
kind: Pod
metadata:
  annotations:
    cni.projectcalico.org/podIP: 172.29.22.66/32
    fake-annotiation: '"bar"'
    # ...

Anything else we need to know?:

This worked in Argo 2.3.0. I switched the 2.3.0 CLI and ran against Argo workflow controller 2.4.3 and it worked as expected:

$ argo version
argo: v2.3.0
  BuildDate: 2019-05-20T22:11:23Z
  GitCommit: 88fcc70dcf6e60697e6716edc7464a403c49b27e
  GitTreeState: clean
  GitTag: v2.3.0
  GoVersion: go1.11.5
  Compiler: gc
  Platform: darwin/amd64
$ argo submit workflows/bad_string_parameter_interpolation.yaml -f workflows/parameters/test-string-interpolation_params.yaml
Name:                extra-double-quotesmwfqj
Namespace:           default
ServiceAccount:      default
Status:              Pending
Created:             Thu Dec 26 12:09:05 -0500 (now)
Parameters:
  some-string-variable: bar

Environment:

  • Argo version:
$ argo version
argo: v2.4.3
  BuildDate: 2019-12-06T03:36:38Z
  GitCommit: cfe5f377bc3552fba90afe6db7a76edd92c753cd
  GitTreeState: clean
  GitTag: v2.4.3
  GoVersion: go1.11.5
  Compiler: gc
  Platform: darwin/amd64
  • Kubernetes version :
$ kubectl version -o yaml
clientVersion:
  buildDate: "2019-10-15T12:12:15Z"
  compiler: gc
  gitCommit: a8b52209ee172232b6db7a6e0ce2adc77458829f
  gitTreeState: clean
  gitVersion: v1.13.12
  goVersion: go1.11.13
  major: "1"
  minor: "13"
  platform: darwin/amd64
serverVersion:
  buildDate: "2019-10-15T12:04:30Z"
  compiler: gc
  gitCommit: a8b52209ee172232b6db7a6e0ce2adc77458829f
  gitTreeState: clean
  gitVersion: v1.13.12
  goVersion: go1.11.13
  major: "1"
  minor: "13"
  platform: linux/amd64
bug

Most helpful comment

Tested in 2.5.3. Fix works. Thanks! 馃

All 3 comments

This was already fixed in https://github.com/argoproj/argo/pull/1733. The fix will be released in the next release.

Is this still an issue in v2.5.0? If so - please - re-open this issue.

Tested in 2.5.3. Fix works. Thanks! 馃

Was this page helpful?
0 / 5 - 0 ratings