0004. Creation and deletion policy defaults¶
Status: superseded in part by ADR 0015 (both defaults). Date: 2026-11-13.
Context¶
An operator that overwrites an existing object without asking, and always deletes it when the
CR is deleted, can take over or remove configuration nobody meant to hand over. Two policies make
this explicit: creationPolicy (Create, Adopt, CreateOrAdopt) and deletionPolicy
(Delete, Orphan), with an "acquired" marker in status that records whether the operator
created or adopted the object.
Most users of this operator move existing OpenBao configuration under GitOps. With Create,
every existing object needs an explicit Adopt first. A blanket Orphan leaves stale policies
and roles behind, which keeps access open.
Decision¶
creationPolicydefaults toCreateOrAdopt.status.acquired(CreatedorAdopted) marks the object as ours;Createfails with reasonConflictwhen the object exists and is not ours.deletionPolicydefaults per kind throughAdapter.DefaultDeletionPolicy:Deletefor leaf configuration (policies, roles, quotas),Orphanfor objects that hold data or identities (namespaces, mounts, entities, groups, KV secrets).- A finalizer is added only for
Delete. If the connection or a credential is missing at deletion, the finalizer stays and the reason isCleanupBlocked.
Consequences¶
- Importing existing configuration needs no extra field; adoption is visible in status and events.
- A typo in a name can adopt an unrelated object.
Createexists for teams that want to prevent that. - Deleting a CR removes access it granted, but never destroys data unless the user chose
Deleteon a data-holding kind.
Update (2026-11-14)¶
The deletion default is now Orphan for every kind, set by a CRD default on the shared spec
(design rule 6 in architecture). Delete is opt-in per object. A
CR deleted from Git must never silently remove an auth mount or a policy. The per-kind default
described above no longer applies.