dongjoon-hyun opened a new pull request, #821:
URL: https://github.com/apache/spark-kubernetes-operator/pull/821
### What changes were proposed in this pull request?
This PR adds a `suspend` field to `BaseSpec` with a default value of
`false`. Since both `ApplicationSpec` and `ClusterSpec` extend `BaseSpec`, the
`spec.suspend` field is now opened on both `SparkApplication` and
`SparkCluster` custom resources.
Specifically:
- Added `@Default("false") protected boolean suspend = false;` to `BaseSpec`.
- Regenerated and updated staged Helm chart CRDs
(`sparkapplications.spark.apache.org-v1.yaml` and
`sparkclusters.spark.apache.org-v1.yaml`) for the `v1` version.
- Added `BaseSpecTest` covering default value, getters/setters, and Jackson
serialization/deserialization.
- Added default `isSuspend()` checks to `ApplicationSpecTest` and
`ClusterSpecTest`.
### Why are the changes needed?
Suspending and resuming execution is a standard Kubernetes feature across
workload controllers and operators, as established in [KEP-2232: Suspend
Job](https://github.com/kubernetes/enhancements/tree/master/keps/sig-apps/2232-suspend-jobs)
(see also [Kubernetes Documentation: Suspending a
Job](https://kubernetes.io/docs/concepts/workloads/controllers/job/#suspending-a-job)).
Similar to `spec.suspend` on Kubernetes `Job` and `CronJob`, placing `suspend`
in `BaseSpec` provides a unified specification field across both
`SparkApplication` and `SparkCluster` custom resources, laying the foundation
for workload suspension, pause/resume, and queue controller integration.
### Does this PR introduce _any_ user-facing change?
Yes. Adds an optional `spec.suspend` field (boolean, default: `false`) to
both `SparkApplication` and `SparkCluster` CRDs:
```yaml
spec:
suspend: false
```
### How was this patch tested?
- Added and ran unit tests:
- `BaseSpecTest`
- `ApplicationSpecTest`
- `ClusterSpecTest`
- Verified CRD schema consistency with `./gradlew
:spark-operator-api:assertGeneratedCRDMatchesHelmChart`
- Validated Helm charts with `helm lint --strict
build-tools/helm/spark-kubernetes-operator`
- Verified full quality gate with `./gradlew build`
### Was this patch authored or co-authored using generative AI tooling?
Generated-by: Antigravity
--
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]