feat(operator): apply own CRDs on startup#84
Merged
Conversation
cd4f6b5 to
ecd99e4
Compare
ae585e2 to
36b9625
Compare
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.
36b9625 to
9fea1e9
Compare
ecd99e4 to
593576b
Compare
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.
🤖 Stacks on #83. The operator SSA-patches its two CRDs on boot, driven
by the same
CustomResourceExt::crd()callgen-crdsuses — onesource of truth.
crds.yamlstays generatable via the binary for operators who prefermanaging 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]. Nodelete— the operator never removes a CRD it maystill hold live CRs against.
Install UX
Before:
After:
Field manager for the SSA is
postgres-restore-operator/crd, distinctfrom the operator's normal
postgres-restore-operatormanager, so amanual
kubectl edit crddoesn't fight the operator on ownership.