Skip to content

fix(controller): omit control plane replicas when the tenant omits them - #113

Merged
atbagan merged 2 commits into
mainfrom
fix/provider-owned-replica-default
Aug 30, 2026
Merged

fix(controller): omit control plane replicas when the tenant omits them#113
atbagan merged 2 commits into
mainfrom
fix/provider-owned-replica-default

Conversation

@atbagan

@atbagan atbagan commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

Summary

The StewardControlPlane builder hardcoded a replicas fallback of 1 and always wrote spec.replicas, so any TenantCluster that omitted control plane replicas was forced to 1 — overriding the provider's own default. This changes the builder (and the SCP drift reconciler) to write spec.replicas only when the TenantCluster explicitly sets it:

  • omitted (nil)spec.replicas left unset → Steward / capi-steward applies its default
  • explicit 1 / 2 / 3 → copied exactly
  • explicit 0 is preserved as 0 (never synthesized from nil)

Dependency

Requires the pointer-typed ControlPlaneSpec.Replicas from butlerdotdev/butler-api#49. go.mod currently points butler-api at that branch commit (v0.22.1-0.20260830192233-a58c04aa05ce) so this compiles and tests green; re-point it to the released butler-api tag once #49 merges, before merging this PR.

Test

  • internal/capi/builder_test.go: omitted→omitted, explicit 1/2/3 preserved, explicit 0 never from nil.
  • internal/controller/tenantcluster/tenantcluster_scp_test.go: drift reconciler leaves replicas alone when the TC omits them (provider owns default), patches explicit changes.

The one locally-failing envtest spec (should delete tenant namespace…) fails identically on clean main (missing KubevirtCluster CRD in local envtest) and is unrelated to this change.

The StewardControlPlane builder hardcoded a replicas fallback of 1 and
always emitted spec.replicas, which overrode the provider's own default
for any TenantCluster that did not set control plane replicas. Emit
spec.replicas only when the TenantCluster explicitly sets it (nil stays
unset downstream), so Steward / capi-steward applies its own default.
The StewardControlPlane drift reconciler is updated the same way.

Requires the pointer-typed ControlPlaneSpec.Replicas from butler-api.
Replace the temporary butler-api feature-branch pseudo-version with the
released v0.23.0 tag that contains the pointer-typed
ControlPlaneSpec.Replicas.
@atbagan
atbagan merged commit f63b0b5 into main Aug 30, 2026
8 checks passed
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