Skip to content
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

Support for configmaps in withItems and withParam of loops #5978

Open
Tracked by #7801
joyciep opened this issue May 24, 2021 · 1 comment · May be fixed by #14217
Open
Tracked by #7801

Support for configmaps in withItems and withParam of loops #5978

joyciep opened this issue May 24, 2021 · 1 comment · May be fixed by #14217
Labels
area/looping `withParams`, `withItems`, and `withSequence` area/spec Changes to the workflow specification. type/feature Feature request

Comments

@joyciep
Copy link
Contributor

joyciep commented May 24, 2021

Summary

What change needs making?

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

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}}"]
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 👍.

@joyciep joyciep added the type/feature Feature request label May 24, 2021
@alexec alexec added area/spec Changes to the workflow specification. area/looping `withParams`, `withItems`, and `withSequence` labels Feb 7, 2022
@shuangkun
Copy link
Member

shuangkun commented Jan 19, 2025

Is it possible to add a field “withItemsFrom”

        withItemsFrom:             
          configMapKeyRef:
            name: my-config
            key: tables

shuangkun added a commit to shuangkun/argo-workflows that referenced this issue Feb 23, 2025
shuangkun added a commit to shuangkun/argo-workflows that referenced this issue Feb 23, 2025
shuangkun added a commit to shuangkun/argo-workflows that referenced this issue Feb 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/looping `withParams`, `withItems`, and `withSequence` area/spec Changes to the workflow specification. type/feature Feature request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants