feat(resolver): implement granular resolution and default shard injection#104
Merged
fernando-villalba merged 4 commits intomainfrom Jan 5, 2026
Merged
feat(resolver): implement granular resolution and default shard injection#104fernando-villalba merged 4 commits intomainfrom
fernando-villalba merged 4 commits intomainfrom
Conversation
…tion
This commit refactors the resolver package to implement the "Granular
Resolver Pattern" required for the upcoming validating/mutating webhook.
Changes:
- Implemented `ResolveGlobalTopo`, `ResolveMultiAdmin`, `ResolveCell`,
and `ResolveShard` to orchestrate the full template resolution cycle
(Fetch -> Merge -> Default).
- Updated `PopulateClusterDefaults` to inject a mandatory default Shard
("0") if a TableGroup has no shards. This ensures the "Ultra-Minimalist"
configuration (End-User Example 1) results in running pods.
- Moved shared defaulting helpers (`defaultStatelessSpec`, `defaultEtcdSpec`)
to `resolver.go` for shared use across components.
- Fixed template resolution to return empty structs instead of `nil`
for implicit fallbacks, preventing nil-pointer issues in callers.
- Added comprehensive unit tests for all new resolution methods.
This comment has been minimized.
This comment has been minimized.
Member
|
Looks like the test coverage went down? |
Adds missing test cases to `pkg/resolver/cluster_test.go` to cover conditional branches and edge cases that were previously missed. Changes: - Adds "Pre-populated Fields" test case to `PopulateClusterDefaults` to verify that existing values are preserved and defaults are skipped. - Adds "Fallback" test case to `ResolveMultiAdmin` to cover the path where neither an inline Spec nor a Template is provided. This ensures all logical branches in `pkg/resolver/cluster.go` are fully exercised.
This comment has been minimized.
This comment has been minimized.
Collaborator
Author
Back to 100% |
This comment has been minimized.
This comment has been minimized.
🔬 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.
This PR is needs to be merged before #105
This commit refactors the resolver package to implement the "Granular Resolver Pattern" required for the upcoming validating/mutating webhook.
Changes:
ResolveGlobalTopo,ResolveMultiAdmin,ResolveCell, andResolveShardto orchestrate the full template resolution cycle (Fetch -> Merge -> Default).PopulateClusterDefaultsto inject a mandatory default Shard ("0") if a TableGroup has no shards. This ensures the "Ultra-Minimalist" configuration (End-User Example 1) results in running pods.defaultStatelessSpec,defaultEtcdSpec) toresolver.gofor shared use across components.nilfor implicit fallbacks, preventing nil-pointer issues in callers.