Argo parameters' comparison doesn't work?

42 views Asked by At

In my YAML that defines the flow, I have:

spec:
   arguments:
       parameters:
         - name: param
           value: '{{workflow.name}}'

Later on I have a script container, which runs this Python code:

      print ('here I have {{workflow.name}} and {{workflow.parameters.param}}')
      print ('sanity: {{= 5 == 5}} and {{= "rew" == "rew"}} ')
      print ('but {{=workflow.name == workflow.parameters.param}} ')
      print ('python cmp: ', '{{workflow.name}}' == '{{workflow.parameters.param}}')

The output is:

here I have myname-lp8dv and myname-lp8dv
sanity: true and true
but false
python cmp:  True

Evidently Argo cannot compare strings. But the sanity check shows that it can... Does anyone understand this behavior?

When defining the 'param' parameter, I used either single- or double-quotes, and there's no difference. I also tried defining it without quotes at all, but that didn't work at all.

1

There are 1 answers

0
Arik On

Okay, I found a solution. In the template that serves as my entry point, I defined:

inputs:
  parameters:
    - name: param
      value: "{{workflow.parameters.param}}"

And then, throughout the workflow, instead of using {{workflow.parameters.param}} I use {{inputs.parameters.param}}.

Why does it work? I don't know. Seems like a bug in Argo...