template substitution for `configMapKeyRef`
Summary
want to support template substitution for configMap
something like:
apiVersion: argoproj.io/v1alpha1
kind: WorkflowTemplate
metadata:
name: error-handling1-runner1-task
spec:
templates:
- name: runner1
inputs:
parameters:
- name: config-map-name
- name: img-from-config-map
valueFrom:
configMapKeyRef:
name: "{{inputs.parameters.config-map-name}}"
key: image
container:
image: "{{inputs.parameters.img-from-config-map}}"
command: [sh, -c]
args:
[
"echo this is runner1 {{inputs.parameters.config-map-name}} {{inputs.parameters.img-from-config-map}}",
]
I've tried the example above but it's not working, I suppose this feature is not supported yet. But if my usage is wrong pls let me know.
Use Cases
I might have several parallel configMap (or something like branching) and I would like to indicate the workflow which configMap to pick from
Message from the maintainers:
Love this enhancement proposal? Give it a 👍. We prioritise the proposals with the most 👍.
This might not be possible unfortunately. The security model of the workflow controller means it typcially cannot read configmap in the user's namespace. We would not want to change this.
However, I think there is a similar issue for config maps in parameters. Did you check for that feature?
@alexec sorry but what do you mean by config maps in parameters...basically I was trying to retrieve value from configMap as one of the input parameters, but also want to "template-ize" the configMap name from another input parameter
apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
generateName: arguments-parameters-from-configmap-
labels:
workflows.argoproj.io/test: "true"
annotations:
workflows.argoproj.io/description: |
This example demonstrates loading parameter values from configmap.
Note that the "simple-parameters" ConfigMap (defined in examples/configmaps/simple-parameters-configmap.yaml)
needs to be created first before submitting this workflow.
spec:
entrypoint: whalesay
templates:
- name: whalesay
inputs:
parameters:
# Parameters can also be passed via configmap reference.
- name: message
valueFrom:
configMapKeyRef:
name: simple-parameters
key: msg
container:
image: argoproj/argosay:v2
args: ["echo", "{{inputs.parameters.message}}"]
@alexec that's what I'm using for now, and I want to do further template substitution like
parameters:
# Parameters can also be passed via configmap reference.
- name: config-map-name
- name: message
valueFrom:
configMapKeyRef:
name: {{inputs.parameters.config-map-name}}
key: msg
but I guess that's not easy to do......I'll try to find some other workaround