Skip to content

fix(controller): allow exit handler variables in resource template manifests. Fixes #14368#14465

Open
mrkschneider wants to merge 5 commits intoargoproj:mainfrom
mrkschneider:fix-wf-of-wf-exit-handler
Open

fix(controller): allow exit handler variables in resource template manifests. Fixes #14368#14465
mrkschneider wants to merge 5 commits intoargoproj:mainfrom
mrkschneider:fix-wf-of-wf-exit-handler

Conversation

@mrkschneider
Copy link

@mrkschneider mrkschneider commented May 9, 2025

Fixes #14368

Motivation

Using {{workflow.failures}} within an exit handler in a resource template (workflow of workflows) caused a validation error. The changes allow to use {{workflow.failures}} in this context.

Modifications

For template validation, if the template contains a resource manifest, {{workflow.failures}} is replaced by a temporary placeholder to allow validation to pass. The strategy mirrors what already happens, e.g., when a exit hook is detected in the template.

Verification

Unit test was added. Test workflow from #14368 can now run without problems.

Documentation

Bugfix. Existing documentation suggests that {{workflow.failures}} should work in all contexts where exit handlers are used, including from within a workflow of workflows

@mrkschneider mrkschneider force-pushed the fix-wf-of-wf-exit-handler branch from caa1a4e to cccc42a Compare May 9, 2025 18:41
Signed-off-by: Markus Schneider <markus.schneider89@googlemail.com>
@mrkschneider mrkschneider force-pushed the fix-wf-of-wf-exit-handler branch from cccc42a to 242a472 Compare May 10, 2025 07:45
@mrkschneider mrkschneider marked this pull request as ready for review July 1, 2025 20:45
@patroklossam
Copy link

this fixes invalid spec: templates.trigger-child-workflow: failed to resolve {{workflow.failures}} can someone review and possibly merge it?

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.

workflow of workflows fails to resolve {{workflow.failures}}

2 participants