dongjoon-hyun opened a new pull request, #854:
URL: https://github.com/apache/spark-kubernetes-operator/pull/854

   ### What changes were proposed in this pull request?
   
   This PR aims to support K8s events for `SparkApplication` and `SparkCluster` 
suspended by `spec.suspend`.
   
   | Type | Reason | When |
   |---|---|---|
   | `Normal` | `Suspended` | The resource is held by `spec.suspend`, so the 
driver (or master and worker) is not requested |
   
   Like the `KueueAdmissionPending` event of SPARK-59638, it is republished on 
every reconcile while the hold lasts. The event sink keys the `Event` on the 
reason, so a repeat bumps the `count` of the one `Event` instead of creating 
another. An application held in `ScheduledToRestart` gets the same event, 
because the status of its previous attempt says that a restart is due, not that 
the next attempt is withheld. Resuming publishes no event of its own, since the 
following state transition already reports it.
   
   In addition, the `suspend` E2E group moves from the `static` mode to a new 
`events` mode, which installs the operator with 
`spark.kubernetes.operator.events.enabled=true`.
   
   ### Why are the changes needed?
   
   A suspended resource has no state transition, so users cannot see why it is 
stuck via `kubectl describe`. The initial `Submitted` status of a resource 
created with `suspend: true` is not persisted either, so `kubectl get` shows an 
empty `Current State` as well.
   
   Publishing the event once would not be enough: Kubernetes retains events 
only for a limited time (one hour by default), so a resource suspended for 
longer would end up with neither a status nor an event.
   
   ### Does this PR introduce _any_ user-facing change?
   
   Yes. When `spark.kubernetes.operator.events.enabled` is `true`, the new 
event is published for resources held by `spec.suspend`. To opt out, add 
`Suspended` to `spark.kubernetes.operator.events.excludedReasons`.
   
   ### How was this patch tested?
   
   Pass the CIs with the newly added unit tests in `AppInitStepTest` and 
`ClusterInitStepTest`, and the updated `suspend` E2E test which asserts the 
`Suspended` event for both `SparkApplication` and `SparkCluster`, including its 
`count` to cover the repeated publishing.
   
   ### 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]

Reply via email to