fix(controller): omit control plane replicas when the tenant omits them - #113
Merged
Conversation
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.
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.
Summary
The
StewardControlPlanebuilder hardcoded a replicas fallback of1and always wrotespec.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 writespec.replicasonly when the TenantCluster explicitly sets it:spec.replicasleft unset → Steward / capi-steward applies its defaultDependency
Requires the pointer-typed
ControlPlaneSpec.Replicasfrom butlerdotdev/butler-api#49.go.modcurrently 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 cleanmain(missingKubevirtClusterCRD in local envtest) and is unrelated to this change.