feat(providerconfig): add namespaced v1beta2 credentials surface - #408
Open
markussiebert wants to merge 1 commit into
Open
feat(providerconfig): add namespaced v1beta2 credentials surface#408markussiebert wants to merge 1 commit into
markussiebert wants to merge 1 commit into
Conversation
dariozachow
approved these changes
Sep 4, 2026
…credentials surface
Introduce gitlab.m.crossplane.io/v1beta2 ProviderConfig as the storage version
of the namespaced provider config, with a cleaned-up credentials surface:
- secretRef is a LocalSecretKeySelector, always resolved in the
ProviderConfig's own namespace (no namespace field);
- the filesystem and environment sources, which reference provider-global
state and cannot be scoped to a namespace, are not offered;
- the credentials source enum is narrowed to None;Secret.
Conversion between v1beta1 and v1beta2 uses strategy None (no webhook): the
delta is only dropped/optional fields and a narrowed enum, none of which needs
data transformation. Because v1beta2 is the storage version, fields it does not
define (secretRef.namespace, fs, env) are pruned when a v1beta1 object is
written, and the provider only ever reads v1beta2 - so namespaced credentials
can no longer be sourced across namespaces regardless of the version applied.
v1beta1 is left unchanged except for a version-level deprecation warning
steering users to v1beta2; it stays served (non-storage). ClusterProviderConfig
and ProviderConfigUsage remain v1beta1 only.
The provider resolves namespaced credentials via the v1beta2 ProviderConfig
(GetTokenValueFromLocalSecret) and records the resolved namespace in
Config.CredentialsSecretRef so self-managed token detection keeps comparing
against the managed resource namespace.
Signed-off-by: Markus Siebert <markus.siebert@deutschebahn.com>
Assisted-by: Kiro:claude-opus-4.8
markussiebert
force-pushed
the
feat/providerconfig-namespaced-secret-scope
branch
from
September 4, 2026 14:37
0b2f359 to
1c03ab1
Compare
dariozachow
approved these changes
Sep 7, 2026
Collaborator
|
Thanks @markussiebert — this addressed everything from the last pass, and in a couple of places more cleanly than I suggested. LGTM |
henrysachs
approved these changes
Sep 7, 2026
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
Adds
gitlab.m.crossplane.io/v1beta2ProviderConfigas the storage version ofthe namespaced provider config, with a credentials surface that fits the
namespaced scope:
secretRefis aLocalSecretKeySelector, always resolved in theProviderConfig's own namespace (no
namespacefield);provider-global state (the provider pod's filesystem / process environment)
and cannot be scoped to a single namespace without breaking isolation;
sourceenum is narrowed toNone;Secret.v1beta1is retained (served, non-storage) and only gains a version-leveldeprecation warning steering users to
v1beta2.ClusterProviderConfigandProviderConfigUsageare unchanged (v1beta1 only) — they legitimately need anamespaced secret selector / have no successor.
The provider resolves namespaced credentials via the v1beta2 ProviderConfig and
records the resolved namespace in
Config.CredentialsSecretRef, so self-managedtoken detection keeps comparing against the managed resource namespace.
Conversion
Strategy
None(no webhook). The v1beta1 -> v1beta2 delta is onlydropped/optional fields and a narrowed enum, none of which needs data
transformation. Because v1beta2 is storage, fields it does not define
(
secretRef.namespace,fs,env) are pruned when a v1beta1 object is written,and the provider only ever reads v1beta2 — so namespaced credentials can no
longer be sourced across namespaces regardless of the version applied.
Backward compatibility
manifests and stored objects keep working.
ClusterProviderConfig/ProviderConfigUsageCRDs are byte-identical tobefore.
secretRef.namespacewasalready ignored (own-namespace enforced) and
fs/envwere neverimplemented. The only visible change is that these already-ignored fields no
longer persist on v1beta1 (pruned at v1beta2 storage), plus the deprecation
warning.
intentionally kept served here so nothing must migrate now.
Testing
go build ./...,go vet ./...,go test ./...pass;make generateproduces no drift.
provider running out-of-cluster:
SelfManaged=True) and one forcedself-rotation (token id changes, then settles, no rotation storm);
namespaceprunedat storage);
kubectl apply.