So I try to get the value from a configMap as input to a template in a Argo workflow template. I want to use a variable in the name attribute, see example.
apiVersion: argoproj.io/v1alpha1
kind: WorkflowTemplate
metadata:
name: configmapkeyref-variable-name
spec:
entrypoint: prepare
ttlStrategy:
secondsAfterCompletion: 3600 # 1h
podGC:
strategy: OnWorkflowSuccess
serviceAccountName: fke-job-sa
arguments:
parameters:
- name: a
value: valueA
templates:
- name: prepare
inputs:
parameters:
- name: a
value: '{{workflow.parameters.a}}'
- name: hook
valueFrom:
configMapKeyRef:
name: "hooks-{{workflow.parameters.a}}" # This don't work!
# name: "hooks-a" # This works!
key: prepare
default: "default value"
script:
image: ubuntu:latest
imagePullPolicy: Always
command: ["/bin/bash"]
source: |
echo "nameA: {{workflow.parameters.a}}"
echo "nameA: {{inputs.parameters.a}}"
echo "HOOK: {{inputs.parameters.hook}}"
I’m not sure it this is possible at all but need to get fetch different configMaps depending on parameter “a”.
I wonder if anyone can help me out with this? =) I have spent a lot of time to read on the documentation pages but i’m stuck :/
Best regards
Thomas