Skip to content

fix(validate): validate placeholder step names#15991

Open
thevilledev wants to merge 1 commit intoargoproj:mainfrom
thevilledev:fix/issue-15896
Open

fix(validate): validate placeholder step names#15991
thevilledev wants to merge 1 commit intoargoproj:mainfrom
thevilledev:fix/issue-15896

Conversation

@thevilledev
Copy link
Copy Markdown
Contributor

@thevilledev thevilledev commented Apr 18, 2026

Fixes #15896

Motivation

After #15744 fixed placeholder leakage for inline template sources, validation still rejected step names that contained {{inputs.parameters.*}}. ProcessArgs substitutes internal placeholder tokens before validateSteps runs, so names like:

run-{{inputs.parameters.date}}

become:

run-__argo__internal__placeholder-N

during validation. They fail the workflow field-name regex because the placeholder contains underscores, against k8s naming regex.

The previous branch version skipped validation for any name containing a placeholder. That broadened the change beyond the reported step-name regression and weakened unrelated field validation. This PR keeps the fix scoped to step names.

Modifications

Add placeholder-aware step-name validation in workflow/validate/validate.go. The validator now replaces internal placeholder fragments with a short valid sentinel ("x") before applying the existing workflow field-name rules. This allows dynamic step names to pass validation while still checking the literal name skeleton around
the placeholder.

Keep validateWorkflowFieldNames unchanged so template names, parameter names, artifact names, and DAG task names continue to use their existing validation paths.

Add regression tests for the reported templateRef scenario and the equivalent local-steps case. Add a negative test that verifies invalid literal step names such as run_{{inputs.parameters.date}} still fail validation.

Verification

Added regression coverage for the scenario from #15896 and for a local workflow variant. Verified that valid dynamic step names now pass and that invalid literal skeletons still fail.

Documentation

No documentation changes needed. This is a validation bugfix.

ProcessArgs substitutes "{{inputs.parameters.xxx}}" with
"__argo__internal__placeholder-N" before validation runs.
That placeholder contains underscores which fail the K8s
naming regex, rejecting previously valid dynamic step
names. Validate placeholder-based step names without
weakening other workflow field checks, and keep rejecting
invalid literal name skeletons.

Signed-off-by: Ville Vesilehto <ville@vesilehto.fi>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Regression: {{inputs.parameters}} in step name causes invalid placeholder validation error since v4.0

1 participant