argoproj / argoproj/argo-workflows

Support for configmaps in `withItems` and `withParam` of loops

Open
#5,978 1 comment 21 reactions 0 assignees View on GitHub
area/looping area/spec
Dominant language
Go
Stars
17k
Forks
3.7k
Avg merge
1d 20h
Merged PRs (30d)
138

Description

# Summary

What change needs making?

Add a way to reference values from configmaps in `withItems` / `withParam` in loops. Something like

```yaml
apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
generateName: loops-
spec:
entrypoint: loop-example
templates:
- name: loop-example
steps:
- - name: print-message
template: whalesay
arguments:
parameters:
- name: message
value: "{{item}}"
withItems: # invoke whalesay once for each item in parallel
configMapKeyRef:
name: my-config
key: tables

- name: whalesay
inputs:
parameters:
- name: message
container:
image: docker/whalesay:latest
command: [cowsay]
args: ["{{inputs.parameters.message}}"]
```

```yaml
apiVersion: v1
kind: ConfigMap
metadata:
name: my-config
data:
tables:
- table1
- table2
- table3
```

# Use Cases

When would you use this?

My usecase is to reuse an existing configmap used by other deployments and I can easily change the configuration across my workflows and deployments.

---

**Message from the maintainers**:

Impacted by this bug? Give it a 👍. We prioritise the issues with the most 👍.

Contributor guide

Open the contributing guide

Research direction

Start by locating the workflow loop handling for withItems and withParam, then trace how Kubernetes ConfigMap references are resolved elsewhere in the project. Confirm the expected behavior using the YAML examples: values from the named ConfigMap key should expand into loop items for workflow steps, while existing loop forms continue to work.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, kubernetes
Domain
backend, infrastructure
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.