Skip to content

feat(resolver): implement system catalog smart defaulting#103

Merged
fernando-villalba merged 1 commit intomainfrom
feature/resolver-smart-defaulting
Jan 3, 2026
Merged

feat(resolver): implement system catalog smart defaulting#103
fernando-villalba merged 1 commit intomainfrom
feature/resolver-smart-defaulting

Conversation

@fernando-villalba
Copy link
Collaborator

This commit implements the "Smart Defaulting" logic for the System Catalog as defined in Design 8 (API) and Design 4 (Admission Control).

Previously, the resolver only applied static defaults (images, template refs), leaving the spec.databases list empty if not provided by the user. This prevented the "Ultra-Minimalist" configuration (defining only Cells) from functioning, as no database would be reconciled.

Changes:

  • Update PopulateClusterDefaults to automatically inject the mandatory postgres database (marked default) if the database list is empty.
  • Automatically inject the mandatory default TableGroup if a database's tablegroup list is empty.
  • Add system constants for default database and tablegroup names.
  • Update unit tests to verify that minimalist configs now resolve to a fully valid System Catalog topology.

This prepares the shared resolver logic for the upcoming Mutating Webhook implementation and immediately fixes the fallback path for the Controller.

This commit implements the "Smart Defaulting" logic for the System Catalog
as defined in Design 8 (API) and Design 4 (Admission Control).

Previously, the resolver only applied static defaults (images, template refs),
leaving the `spec.databases` list empty if not provided by the user. This
prevented the "Ultra-Minimalist" configuration (defining only Cells) from
functioning, as no database would be reconciled.

Changes:
- Update `PopulateClusterDefaults` to automatically inject the mandatory
  `postgres` database (marked default) if the database list is empty.
- Automatically inject the mandatory `default` TableGroup if a database's
  tablegroup list is empty.
- Add system constants for default database and tablegroup names.
- Update unit tests to verify that minimalist configs now resolve to a
  fully valid System Catalog topology.

This prepares the shared resolver logic for the upcoming Mutating Webhook
implementation and immediately fixes the fallback path for the Controller.
@github-actions
Copy link

github-actions bot commented Jan 3, 2026

🔬 Go Test Coverage Report

Summary

Coverage Type Result
Threshold 0%
Previous Test Coverage Unknown%
New Test Coverage 100.0%

Status

✅ PASS

Detail

Show New Coverage
github.com/numtide/multigres-operator/pkg/resolver/cell.go:14:		ResolveCellTemplate	100.0%
github.com/numtide/multigres-operator/pkg/resolver/cell.go:44:		MergeCellConfig		100.0%
github.com/numtide/multigres-operator/pkg/resolver/cluster.go:18:	PopulateClusterDefaults	100.0%
github.com/numtide/multigres-operator/pkg/resolver/cluster.go:106:	defaultEtcdSpec		100.0%
github.com/numtide/multigres-operator/pkg/resolver/cluster.go:125:	defaultStatelessSpec	100.0%
github.com/numtide/multigres-operator/pkg/resolver/cluster.go:144:	isResourcesZero		100.0%
github.com/numtide/multigres-operator/pkg/resolver/cluster.go:156:	ResolveCoreTemplate	100.0%
github.com/numtide/multigres-operator/pkg/resolver/cluster.go:188:	ResolveGlobalTopo	100.0%
github.com/numtide/multigres-operator/pkg/resolver/cluster.go:220:	ResolveMultiAdmin	100.0%
github.com/numtide/multigres-operator/pkg/resolver/defaults.go:57:	DefaultResourcesAdmin	100.0%
github.com/numtide/multigres-operator/pkg/resolver/defaults.go:71:	DefaultResourcesEtcd	100.0%
github.com/numtide/multigres-operator/pkg/resolver/resolver.go:26:	NewResolver		100.0%
github.com/numtide/multigres-operator/pkg/resolver/resolver.go:42:	mergeStatelessSpec	100.0%
github.com/numtide/multigres-operator/pkg/resolver/shard.go:14:		ResolveShardTemplate	100.0%
github.com/numtide/multigres-operator/pkg/resolver/shard.go:44:		MergeShardConfig	100.0%
github.com/numtide/multigres-operator/pkg/resolver/shard.go:88:		mergeMultiOrchSpec	100.0%
github.com/numtide/multigres-operator/pkg/resolver/shard.go:98:		mergePoolSpec		100.0%
total:									(statements)		100.0%

@fernando-villalba fernando-villalba merged commit 0f8c992 into main Jan 3, 2026
3 checks passed
@fernando-villalba fernando-villalba deleted the feature/resolver-smart-defaulting branch January 3, 2026 14:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant