Support for substituting variables in configMapKeyRef was added in https://github.com/argoproj/argo-workflows/pull/7542 by manually parsing templates out of the string, instead of using the standard template.Replace() function. Since the manual parsing logic uses the same syntax as simple template tags (e.g. {{workflow.parameters.cm-name}}), users reasonably expect it to work the same, but it doesn't, which leads to confusion. Additionally, supporting templates like {{workflow.parameters.cm-name}}-cm is important, because that's a common pattern.
Modifications
This replaces the manual parsing code with the standard template.Replace() function that everything else uses.
Fixes #13890
Motivation
Support for substituting variables in
configMapKeyRef
was added in https://github.com/argoproj/argo-workflows/pull/7542 by manually parsing templates out of the string, instead of using the standardtemplate.Replace()
function. Since the manual parsing logic uses the same syntax as simple template tags (e.g.{{workflow.parameters.cm-name}}
), users reasonably expect it to work the same, but it doesn't, which leads to confusion. Additionally, supporting templates like{{workflow.parameters.cm-name}}-cm
is important, because that's a common pattern.Modifications
This replaces the manual parsing code with the standard
template.Replace()
function that everything else uses.Verification
Verified by running the example workflow from https://github.com/argoproj/argo-workflows/issues/13890 locally: