-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Variable substitution does not work for ConfigMapKeySelector
at global Workflow
or Step
level
#7061
Comments
This might have been fixed by @smile-luobin in #6898 but need to double check. |
@terrytangyuan @smile-luobin |
@terrytangyuan I will take back my comments. It is happening in operate function. I kind of think about how we can fix this. it is a kind of |
@terrytangyuan One alternative, we can have substitute reference in |
I'm hitting this limitation also, and in my case, my template uses the If I can not make it dynamically I don't know how to tell the template to load a config map depending on an argument parameter. Is there any workaround to this, or a correct way to do it in Argo?. Example of what I'm doing: apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
generateName: workflow-template-simulation-
spec:
entrypoint: dag-simulation
serviceAccountName: argo
arguments:
parameters:
- name: config
value: false
templates:
- name: watchdog-config
inputs:
parameters:
- name: container
valueFrom:
configMapKeyRef:
name: '{{workflow.parameters.config}}'
key: container
script:
image: busybox
command: [sh]
source: |
.... |
I am okay with this. Checking configmaps is not expensive since we have our own informer now. |
@terrytangyuan I mean |
Maybe this is the limitation of parameter substitution. As far as i know, parameter substitutions can be done succeeded in these common scenarios:
But other scenarios are not supported:
I think it better to document these supported scenarios of parameter substitution. |
@smile-luobin Do you like to submit the documentation PR for this? |
As @sarabala1979 mentioned, the approach would be to check Would anyone like to submit a PR for this? |
Summary
Environment
argo-workflows
frommaster
installed from https://raw.githubusercontent.com/argoproj/argo-workflows/master/manifests/quick-start-postgres.yamlv1.22.2
v1.23.2
Given the instructions defined here https://github.com/argoproj/argo-workflows/blob/master/docs/variables.md I expect that variables work in every field of a
Workflow
resource. I am using aConfigMapKeySelector
which has a key that references a global or local step variable. The expansion does not work and the following template is parsed as a string:{{ workflow.parameters.var }}
Diagnostics
Example
ConfigMap
applied on theargo
namespace:Applied
Workflow
s:The error messages I get when submitting this
Workflow
from the UI are:and for the second
Workflow
:Is this a problem with nested fields or doesn't the
ConfigMapKeySelector
work with dynamic variable substitution?Linking to #6869
Message from the maintainers:
Impacted by this bug? Give it a 👍. We prioritise the issues with the most 👍.
The text was updated successfully, but these errors were encountered: