generated from kubernetes/kubernetes-template-project
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Open
Description
The core runtime reconciliation logic currently lacks unit test coverage, which makes future changes to runtime lifecycle handling risky and harder to validate.
RuntimeReconciler is responsible for managing the full lifecycle of a runtime (Setup, Sync, Delete), including critical behaviors such as owner references, finalizers, requeue logic, and cleanup during deletion. At the moment, these behaviors are not protected by unit tests.
Why this matters
- Runtime reconciliation is core control-plane logic
- Changes to this code can silently introduce regressions
- Lack of unit tests makes refactoring and maintenance harder
- Controller-level tests improve long-term stability and contributor confidence
Evidence
- pkg/controllers/runtime_controller.go contains the main reconciliation logic
- No corresponding runtime_controller_test.go existed prior to this fix
- Other controller files in the same directory show similar testing gaps
Proposed Solution
- Add controller-level unit tests using controller-runtime’s fake client to validate:
- OwnerReference creation linking Runtime → Dataset
- Finalizer addition during normal reconciliation
- Finalizer removal and cleanup during deletion
- Happy-path reconciliation (Setup / Sync)
Error propagation when runtime engine creation fails
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels