feat(cluster-handler): integrate resolver and enforce v1alpha1 compliance#105
Merged
fernando-villalba merged 2 commits intomainfrom Jan 5, 2026
Merged
Conversation
This comment has been minimized.
This comment has been minimized.
Member
|
If there is a merge order requirements, please update the merge target branch to be |
1efaacf to
ab1081b
Compare
This comment has been minimized.
This comment has been minimized.
Collaborator
Author
Excellent suggestion - done! |
This comment has been minimized.
This comment has been minimized.
…ance This commit refactors the MultigresCluster controller to fully integrate the new granular resolver logic and ensure strict compliance with the v1alpha1 API. Changes: - Integrated `resolver` package to handle the 4-level override chain for GlobalTopo, MultiAdmin, Cells, and Shards directly in the reconciler. - Added in-memory execution of `PopulateClusterDefaults` at the start of reconciliation. This guarantees the "System Catalog" (postgres/default/shard-0) is injected even if the mutating webhook is disabled or fails. - Updated child resource creation (Cells, TableGroups) to use the new nested `Images` struct, ensuring `ImagePullPolicy` and `ImagePullSecrets` are correctly propagated. - Updated integration tests to respect strict v1alpha1 validation rules (Database must be "postgres", TableGroup must be "default").
…troller
This commit introduces a comprehensive unit test suite for the MultigresCluster
controller to close the coverage gap left by integration tests, bringing the
package to 100% statement coverage.
Changes:
- Added `pkg/cluster-handler/controller/multigrescluster/multigrescluster_controller_test.go`:
- Implements a test suite using a fake client with interceptors to simulate API errors.
- Covers critical error paths and edge cases, including:
- Connection errors on Get/List operations.
- Status update failures.
- Pruning of orphaned child resources (Cells, TableGroups).
- Implicit cell sorting and deduplication logic during Shard resolution.
- Validation of "clean exit" on resource deletion.
- Updated `pkg/cluster-handler/controller/multigrescluster/doc.go`:
- Clarified that the Global TopoServer is only managed in "Managed" (Etcd) mode.
- Documented the explicit in-memory defaulting step (`PopulateClusterDefaults`) used for robustness.
0364db2 to
32486b2
Compare
🔬 Go Test Coverage ReportSummary
Status✅ PASS DetailShow New Coverage |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
MUST merge PR #104 first!
This commit refactors the MultigresCluster controller to fully integrate the
new granular resolver logic and ensure strict compliance with the v1alpha1 API.
Changes:
resolverpackage to handle the 4-level override chain forGlobalTopo, MultiAdmin, Cells, and Shards directly in the reconciler.
PopulateClusterDefaultsat the start ofreconciliation. This guarantees the "System Catalog" (postgres/default/shard-0)
is injected even if the mutating webhook is disabled or fails.
Imagesstruct, ensuringImagePullPolicyandImagePullSecretsarecorrectly propagated.
(Database must be "postgres", TableGroup must be "default").