argoproj / argoproj/argo-workflows

Allow template in configMapRefKey name at global level

Open
#14,320 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
17k
Forks
3.7k
Avg merge
1d 20h
Merged PRs (30d)
138

Description

# Summary

When declaring a global parameter in a workflow we can use valueFrom to fill the value from a configmap but the name of the configmap currently can't be templated. It would be like this (from an official example):

```
apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
generateName: global-parameter-values-from-configmap-
labels:
workflows.argoproj.io/test: "true"
annotations:
workflows.argoproj.io/description: |
This example demonstrates loading global parameter values from a 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: print-message
# Parameters can also be passed via configmap reference.
arguments:
parameters:
- name: config
value: simple-parameters
- name: message
valueFrom:
configMapKeyRef:
name: "{{ workflow.parameters.message }}"
key: msg

templates:
- name: print-message
container:
image: busybox
command: ["echo"]
args: ["{{workflow.parameters.message}}"]
```

## Use Cases

From my provided example, we would be able to provided a set of config that would be like "profiles", those configmap would be used to define value of parameters of the workflows but still allow user that call the workflow to overwrite some values.

Currently I am able to do that by having a parent workflow that will only have the configmap as argument, read parameters from the configmap and call the target workflow with the parameters but it would be neater with this feature

---

**Message from the maintainers**:

Love this feature request? Give it a 👍. We prioritise the proposals with the most 👍.

Contributor guide

Open the contributing guide

Research direction

Start with the global workflow parameter example and examples/configmaps/simple-parameters-configmap.yaml, then trace how valueFrom and configMapKeyRef are resolved. Done means the ConfigMap name can use a workflow-parameter template at the global level while still allowing the referenced key value to populate the parameter.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, kubernetes
Domain
devops
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.