Skip to content

feat(operator): apply own CRDs on startup#84

Merged
passcod merged 1 commit into
mainfrom
feat/operator-applies-crds
Jul 1, 2026
Merged

feat(operator): apply own CRDs on startup#84
passcod merged 1 commit into
mainfrom
feat/operator-applies-crds

Conversation

@passcod

@passcod passcod commented Jul 1, 2026

Copy link
Copy Markdown
Member

🤖 Stacks on #83. The operator SSA-patches its two CRDs on boot, driven
by the same CustomResourceExt::crd() call gen-crds uses — one
source of truth.

crds.yaml stays generatable via the binary for operators who prefer
managing CRD lifecycle out-of-band (schema-change gating at install
time, GitOps CRD lifecycles, etc.).

RBAC

The operator ClusterRole gains
customresourcedefinitions.apiextensions.k8s.io: [get, list, create, update, patch]. No delete — the operator never removes a CRD it may
still hold live CRs against.

Install UX

Before:

cargo run --bin gen-crds > crds.yaml
kubectl apply -f crds.yaml
kubectl apply -f operator.yaml

After:

kubectl apply -f operator.yaml

Field manager for the SSA is postgres-restore-operator/crd, distinct
from the operator's normal postgres-restore-operator manager, so a
manual kubectl edit crd doesn't fight the operator on ownership.

@passcod passcod force-pushed the feat/operator-applies-crds branch from cd4f6b5 to ecd99e4 Compare July 1, 2026 17:23
@passcod passcod force-pushed the feat/canopy-shm-floor branch from ae585e2 to 36b9625 Compare July 1, 2026 17:23
The operator now SSA-patches its two CRDs on boot, driven by the same
CustomResourceExt::crd() call that gen-crds uses. crds.yaml stays
generatable via the binary for operators who prefer to manage CRD
lifecycle out-of-band.

RBAC: operator ClusterRole gains
customresourcedefinitions.apiextensions.k8s.io:
[get, list, create, update, patch]. No delete — the operator never
removes a CRD it may still hold live CRs against.

Install becomes one `kubectl apply -f operator.yaml`; the extra
`kubectl apply -f crds.yaml` step is gone from the readme quickstart.
@passcod passcod force-pushed the feat/canopy-shm-floor branch from 36b9625 to 9fea1e9 Compare July 1, 2026 17:33
@passcod passcod force-pushed the feat/operator-applies-crds branch from ecd99e4 to 593576b Compare July 1, 2026 17:33
Base automatically changed from feat/canopy-shm-floor to main July 1, 2026 23:05
@passcod passcod merged commit 1704311 into main Jul 1, 2026
16 of 28 checks passed
@passcod passcod deleted the feat/operator-applies-crds branch July 1, 2026 23:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant