<#7006 Add TaskAction validation before finalizer ...
# flyte-github
a
#7006 Add TaskAction validation before finalizer registration Pull request opened by AdilFayyaz Tracking issue Closes #6934 Why are the changes needed? In PR #6903, it was noted that plugin resolution (the check for whether a registered plugin exists for a given taskType) happened after the finalizer was added to the resource. This meant that if a TaskAction had an unrecognized taskType, the controller would: 1. Add a finalizer on the first reconcile 2. Discover the plugin is missing on the second reconcile 3. Mark the resource terminal At that point, deleting the resource requires the controller to run
handleAbortAndFinalize
to remove the finalizer even though no plugin ever ran and there is nothing to clean up. Additionally,
validateSpec
only checked 4 of the 9 required spec fields, leaving runName, org, project, domain, and actionName unvalidated at the controller level. What changes were proposed in this pull request? • Replaced the separate
validateSpec
function and inline
ResolvePlugin
block with a unified
validateTaskAction
function that validates all required spec fields and resolves the plugin in a single pass • This validation now runs before the finalizer is added if validation fails, the resource is marked terminal (Failed condition), not requeued, and no finalizer is registered, making deletion trivial • Introduced a
pluginResolver
interface so
validateTaskAction
is testable without a real plugin registry • Added
taskaction_validation_test.go
with standard Go unit tests covering all 9 required field checks and the plugin-not-found case • Fixed the existing integration test fixture which was missing required fields (taskType, taskTemplate) How was this patch tested? • Unit tests:
go test ./pkg/controller/... -run TestValidateTaskAction -v
covers all 9 missing-field cases and plugin-not-found • Integration test:
go test ./pkg/controller/... -v
confirms reconcile completes without error and sets conditions Setup process Screenshots Check all the applicable boxes • I updated the documentation accordingly. • All new and existing tests passed. • All commits are signed-off. Related PRs Docs link •
main
• #6583 • #7006 👈 flyteorg/flyte