Skip to content

fix: Adjust parameter value overriding. Fixes #14426 #14462

New issue

Have a question about this project? Sign up for a free account to open an issue and contact its maintainers and the community.

By clicking “Sign up for ”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on ? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

nicdard
Copy link

@nicdard nicdard commented May 8, 2025

Fixes #14426

Motivation

See the related issue description. It fixes the Inconsistent behavior for Workflow Arguments vs Template inputs to prioritise Value over ConfigMapKeyRef problem, and more in general the way the merge over the parameters containing values is performed.

Modifications

  • Modified the spec merge functionality JoinWorkflowSpec inside workflow/util/merge.go:
    • Arguments.Parameters has strategy merge
    • However when we merge the Value, ValueFrom, Default can conflict if they come from Wf, Wft or DefaultWf
    • The change aims of removing this ambiguity, so that the resulting execWf uses the proper value given the priority Wf -> Wft -> DefaultWf.
  • No UI changes.

Verification

Add unit tests to verify the changes. Tested with the given reproducible example from the issue and verified:

apiVersion: v1
kind: ConfigMap
metadata:
  name: config-properties
  namespace: argo
  labels:
    workflows.argoproj.io/configmap-type: Parameter
data:
  message: "message from config map"
---
apiVersion: argoproj.io/v1alpha1
kind: WorkflowTemplate
metadata:
  name: wf-template-echo
  namespace: argo
spec:
  entrypoint: echo
  arguments:
    parameters:
      - name: message
        valueFrom:
          configMapKeyRef:
            name: config-properties
            key: message
  templates:
    - name: echo
      container:
        image: busybox
        command: [echo]
        args: ["{{workflow.parameters.message}}"]
---
apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
  generateName: wf-parameter-overwrite-
  namespace: argo
spec:
  entrypoint: echo
  arguments:
    parameters:
      - name: message
        value: "configmap argument overwrite with argument"
  workflowTemplateRef:
    name: wf-template-echo

Documentation

@MasonM
Copy link
Member

/retest

@MasonMMasonM self-requested a review May 8, 2025 15:40
@MasonMMasonM self-assigned this May 8, 2025
@nicdardnicdard marked this pull request as ready for review May 8, 2025 15:55
Sign up for free to join this conversation on . Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Inconsistent behavior for Workflow Arguments vs Template inputs to prioritise Value over ConfigMapKeyRef
2 participants