feat: Add pod-free wait-for-delete resource action. Fixes #15874#15875
Open
AndreKurait wants to merge 1 commit intoargoproj:mainfrom
Open
feat: Add pod-free wait-for-delete resource action. Fixes #15874#15875AndreKurait wants to merge 1 commit intoargoproj:mainfrom
AndreKurait wants to merge 1 commit intoargoproj:mainfrom
Conversation
24f598f to
cfe2876
Compare
cfe2876 to
6b05505
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #15874
Motivation
There is currently no clean way to block a workflow until a Kubernetes resource is fully deleted without creating a pod. Users resort to script templates running
kubectl wait --for=deletein a loop, which incurs pod scheduling, image pull, and memory overhead for what is fundamentally a single API call.This adds a new pod-free
action: waitwithwaitFor: deletefor resource templates, following the same controller-side pattern used by Suspend nodes.Modifications
workflow_types.go): Addedwaitto theActionenum and a newWaitForfield (enum:delete) onResourceTemplate.validate.go):waitForis required whenaction: wait, forbidden otherwise.successCondition,failureCondition, and outputs are disallowed withwait.operator.go):executeResourceinterceptsaction: waitbefore pod creation.checkResourceWaitForDeleteuses the dynamic client to check resource existence — 404 means succeeded, exists means requeue.podReconciliationskips wait-action nodes so they are not flagged as pod-missing.controller.go): Added arestMapperto resolve GVK → GVR for the dynamic client GET.controller-genandopenapi-gen.Verification
operator_test.go): Two test cases — resource already deleted (→ Succeeded), resource still exists (→ Running, no pod created).validate_test.go): Five test cases covering valid usage and all invalid combinations (missing waitFor, waitFor on non-wait action, with successCondition, with outputs).TestInvalidResourceWorkflowexpected error message to includewaitin the valid actions list. Fullworkflow/controller(82s) andworkflow/validatetest suites pass.resource_template_test.go):TestWaitForDeleteAlreadyGone— submits a workflow that waits for a non-existent ConfigMap, expects immediate success.golangci-lintv2.11.3 passes with 0 issues.go vetclean. Feature doc validated.Documentation
docs/resource-template.md: Added "Wait for Resource Deletion" section with usage example..features/pending/wait-for-delete-resource-action.md: Feature description file for release notes.waitForenum is designed for future extension (e.g.waitFor: condition) without breaking changes.