dongjoon-hyun opened a new pull request, #865:
URL: https://github.com/apache/spark-kubernetes-operator/pull/865
### What changes were proposed in this pull request?
This PR adds `KueueWorkloadUtils.finishWorkload()`, which records the Kueue
`Finished` condition on
a `Workload` with the `Succeeded` or `Failed` reason, and calls it from the
`AppCleanUpStep` early
return that appends `TerminatedWithoutReleaseResources`.
Two restrictions are intentional:
- Only `Succeeded` and `Failed` are finished. The other stopping states
leave a retained driver
running, which must keep holding its quota.
- Only this path uses the condition. The other paths keep deleting the
`Workload`, because the
`Workload` name is fixed per custom resource and a finished one left
behind would be read as
admitted by a restarted attempt.
A failed status update falls back to deleting the `Workload`, since this
path is not reconciled
again. The chart already grants `patch` on `workloads/status`, so no RBAC
change is needed.
### Why are the changes needed?
An application with a Kueue queue name, a resource retain policy and
`restartPolicy: Never`
returns before the `releaseWorkload()` call, so its `Workload` is left
behind and Kueue keeps the
quota reserved for an application that already finished.
Deleting the `Workload` is not the right fix, because the resources are
deliberately retained.
Kueue's built-in integrations set the `Finished` condition instead, on which
Kueue frees the quota
and counts the attempt in `kueue_finished_workloads_total`. This PR follows
that convention.
### Does this PR introduce _any_ user-facing change?
No because the Kueue feature is not released yet.
### How was this patch tested?
Pass the CIs.
### Was this patch authored or co-authored using generative AI tooling?
Generated-by: Claude Opus 5
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]