fix: detect spec changes in ScheduledSparkApplication controller#2842
fix: detect spec changes in ScheduledSparkApplication controller#2842puwun wants to merge 1 commit intokubeflow:masterfrom
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
There was a problem hiding this comment.
Pull request overview
This PR addresses issue #2555 by adding spec-change detection to the ScheduledSparkApplication controller using the standard Kubernetes generation / status.observedGeneration pattern, so schedule-related spec updates are re-applied after the resource is already scheduled and after validation failures.
Changes:
- Add
status.observedGenerationtoScheduledSparkApplicationStatusand CRD schemas. - Update the controller reconcile loop to detect spec changes and (a) recalculate
status.nextRunwhile scheduled, and (b) resetFailedValidationback toNewon spec updates. - Add regression tests for schedule-change recalculation and recovery from
FailedValidationafter a spec fix.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
internal/controller/scheduledsparkapplication/controller.go |
Implements observedGeneration-based spec change detection and nextRun recalculation / FailedValidation recovery. |
internal/controller/scheduledsparkapplication/controller_test.go |
Adds regression tests covering schedule change and FailedValidation recovery scenarios. |
api/v1beta2/scheduledsparkapplication_types.go |
Adds ObservedGeneration to the status type. |
config/crd/bases/sparkoperator.k8s.io_scheduledsparkapplications.yaml |
Updates CRD schema to include status.observedGeneration. |
charts/spark-operator-chart/crds/sparkoperator.k8s.io_scheduledsparkapplications.yaml |
Mirrors the CRD schema update for Helm chart distribution. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
internal/controller/scheduledsparkapplication/controller_test.go
Outdated
Show resolved
Hide resolved
852ab5c to
fcc169b
Compare
Add status.observedGeneration field to detect spec changes. Recalculate status.nextRun when schedule changes, and reset FailedValidation state when spec is updated. Fixes kubeflow#2555 Signed-off-by: Pavan More <pavansmore05@gmail.com>
fcc169b to
3ebe4f8
Compare
Fixes #2555
Purpose of this PR
The
ScheduledSparkApplicationcontroller ignores spec changes (e.g.schedule,timeZone) once inScheduleStateScheduled, and provides no recovery fromScheduleStateFailedValidation.Proposed changes:
status.observedGenerationto detect spec changes via the standard Kubernetes generation patternstatus.nextRunwhen a spec change is detected inScheduleStateScheduledFailedValidationtoNewon spec change, allowing re-validationChange Category
Checklist
Additional Notes