acoustic-carpenter-78188
04/27/2026, 9:56 PMDeleteFunc fires for both real deletes and DeletedFinalStateUnknown tombstones (delivered when the informer missed events during a watch gap, e.g. sleep/resume).
• buildActionUpdate then unconditionally overwrote phase with ABORTED for any delete event, even for TaskActions that had already reached `Succeeded`/`Failed`.
• notifyRunService pushed that ABORTED phase to the run service, overwriting the recorded terminal status in the DB → UI shows Aborted.
The pre-existing labelTerminalStatusRecorded guard (shouldSkipTaskAction) was only consulted by `AddFunc`/`UpdateFunc`, never by DeleteFunc.
What changes were proposed in this pull request?
Two guards in `actions/k8s/client.go`:
1. DeleteFunc now calls shouldSkipTaskAction after unwrapping the tombstone, so deletes for actions already labeled terminal-status-recorded are dropped before dispatch.
2. buildActionUpdate only forces ABORTED when the current phase is not terminal. This preserves `Succeeded`/`Failed`/`TimedOut` for legitimate post-terminal CR cleanup as well.
How was this patch tested?
go test ./actions/k8s/... -count=1 — passes.
New unit tests in `actions/k8s/client_test.go`:
• TestBuildActionUpdate_DeleteAfterTerminalPreservesPhase — Succeeded and Failed cases (the bug scenario).
• TestBuildActionUpdate_DeleteOnNonTerminalForcesAborted — confirms in-flight deletes still produce ABORTED.
Labels
• fixed
Check all the applicable boxes
• I updated the documentation accordingly.
• All new and existing tests passed.
• All commits are signed-off.
Related PRs
flyteorg/flyteacoustic-carpenter-78188
04/27/2026, 11:25 PM