fix(platform): orphan the shared OpenBaoConnection on XR retirement #684
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/openbao-connection-orphan"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
Set
deletionPolicy: Orphanon theopenbao-connectioncomposedObject. It has no explicit policy today, so it takes the provider default,Delete.Why this is the blocking step for Crossplane retirement
seanfarmPR #750 landed all ten OpenBao CRs this composition manages as plain Flux manifests (kubernetes/flux/infrastructure/openbao-platform). That was the last extraction: this XR tracks exactly ten composed resources, and all ten are now declared in Git and co-managed bykustomize-controllerwith zero field conflict.What remains is retiring the XR safely. This
Objectis the one thing that made that unsafe.The real dependency, traced
The
OpenBaoConnectionthisObjectwraps is referenced by name through a two-hop chain:Five live pipelines resolve credentials through it, across four tenant namespaces:
Under the
Deletedefault, retiring the XR deletes that record and breaks credential renewal for Forgejo, n8n, Hydra, Kratos and Outline until Flux restores it.Orphanhands the CR to Flux cleanly instead.Note the other nine CRs are not affected by this: they carry an inline
openbaoRef.connection.address, not a named reference. They do not depend on this record.Why the nine are already safe
Each carries
spec.deletionPolicy: Retain, and that is enforced, not decorative. Inlibseanfarm-operatorv0.4.13 -- the exact version the deployedopenbao-operatorv0.12.32 pins --reconcile/harness.go:401:Retainskips the whole remote-delete block. TheUnmountSecretscall that would destroy the transit mount and the cosign signing keys lives inside it (openbaotransitbackend_impl.go:152), so it is never reached. The accessor returnsspec.deletionPolicydirectly, with no defaulting.So when the XR is retired, those nine CRs are removed and recreated by Flux, while the OpenBao-side state -- both PKI mounts, the intermediate CA, the three issuing roles, the transit mount and its three keys -- is untouched. There is no functional outage, only a window with no drift correction.
Risk
None to live state. Adding a deletion policy changes nothing while the XR exists; it only changes what happens when the
Objectis eventually removed.tests/check.shexits 0.https://claude.ai/code/session_01GfkEuwuvGSqGyXVuxwT7PA