<#7366 fix(propeller/k8s): treat BadRequest / Inva...
# flyte-github
a
#7366 fix(propeller/k8s): treat BadRequest / Invalid from apiserver as permanent failure Pull request opened by 1fanwang Tracking issue Closes #6531 Why When propeller creates a task pod and the apiserver rejects it with HTTP 400 (
BadRequest
) or HTTP 422 (
Invalid
) — typically a validating admission webhook saying no, or an invalid field caught by the apiserver — the failure path falls through to the default branch and surfaces as a retryable system error. The workflow then burns through its retry budget making the exact same request, with the exact same outcome. These errors are intrinsic to the request payload. Retrying with the same input produces the same rejection. Neighboring
EntityTooLarge
is already handled this way. The right transition was already written but commented out since #1 (2019) with no documented rationale. Uncommenting and adding a regression test. What changed • `flytepropeller/pkg/controller/nodes/task/k8s/plugin_manager.go`: uncomment the
PhaseInfoFailure("BadTaskFormat", ...)
transition so BadRequest / Invalid produce a permanent failure instead of falling through to the system-error path. Added a short comment so this doesn't get re-commented in the future. How was this patch tested? Added two sub-tests to
TestK8sTaskExecutor_Handle_LaunchResource
—
jobBadRequest
(using
k8serrors.NewBadRequest
) and
jobInvalid
(using
k8serrors.NewInvalid
). Both assert
pluginsCore.PhasePermanentFailure
with error code
BadTaskFormat
. Both fail on master and pass with this PR; the full
plugin_manager_test.go
suite stays green.
Copy code
ok  	github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/task/k8s	1.724s
Check all the applicable boxes • I updated the documentation accordingly. • All new and existing tests passed. • All commits are signed-off. flyteorg/flyte