Repository navigation
fix(bootstrap): sync embedded CRDs from butler-api and guard against drift - #59
Merged
Merged
Conversation
…drift The CRDs embedded in `butleradm bootstrap` were a hand-maintained copy with no link to butler-api, the source of truth. They had drifted across 8 CRDs (including the providerconfig credentialsRef CEL) and were missing clustercreationpolicies entirely, because the cli was never wired into the sync-crds automation that already keeps butler-charts current. - hack/sync-crds.sh: copy CRDs from butler-api/config/crd/bases, prune removed - make sync-crds target - CI crd-drift job: re-sync against butler-api and fail on any diff - re-sync all CRDs (now 18, zero drift vs canonical, CEL present) The companion butler-api sync-crds-to-cli workflow opens these PRs automatically.
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.
Problem
The CRDs embedded in
butleradm bootstrap(internal/adm/bootstrap/manifests/crds/, go:embed) were a hand-maintained copy with no link to butler-api, the source of truth. Found during the local pull-mode e2e: the embedded providerconfig CRD lacked thecredentialsRefCEL (the non-local-requires-creds regression fix from butler-api #46 / chart PR #141).The cli was never wired into the
sync-crdsautomation that keeps butler-charts current, so the drift was already 8 CRDs deep (networkpools, teams, users, butlerconfigs, identityproviders, tenantclusters, addondefinitions, providerconfigs) andclustercreationpolicieswas missing entirely.Root fix (single source of truth + two guards)
hack/sync-crds.sh+make sync-crds: copy CRDs from../butler-api/config/crd/bases(same source butler-charts uses), prune removed ones.crd-driftjob: re-runs the sync against a fresh butler-api checkout and fails on any diff — mechanical guard against hand-edits / missed syncs.butlerdotdev/butler-apiworkflow (sync-crds-to-cli.yaml, separate PR) opens these sync PRs automatically on butler-api CRD changes, exactly like the charts flow.Verification (fresh local cluster, the bootstrap path)
butleradm bootstrap localwith the rebuilt cli installs the CEL'd providerconfig CRD. 3-direction admission test on the local cluster:credentialsRef with a non-empty name is required ...)The regression fix is now enforced on the local path, matching chart-installed clusters.
Note
The companion butler-api workflow needs a
CLI_SYNC_PATsecret (write to butler-cli), likeCHARTS_SYNC_PATbacks the charts sync.