-
Notifications
You must be signed in to change notification settings - Fork 600
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update controller-gen and remove our code generation workarounds #4015
Conversation
596225e
to
60406a3
Compare
60406a3
to
a2f3798
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems a little funny not to mention singlenamespace, but I suppose we do that elsewhere, e.g., pgo-examples
required: | ||
- accessModes | ||
- resources | ||
type: object | ||
x-kubernetes-validations: | ||
- message: missing accessModes | ||
rule: has(self.accessModes) && size(self.accessModes) | ||
> 0 | ||
- message: missing storage request | ||
rule: has(self.resources) && has(self.resources.requests) | ||
&& has(self.resources.requests.storage) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤔 This affects the API reference documentation. The required column changes from yes to no.
kubectl explain
also calls out required
:
$ kubectl explain postgresclusters.spec.instances.dataVolumeClaimSpec
…
FIELDS:
accessModes <[]string> -required-
accessModes contains the desired access modes the volume should have.
…
Updates to the latest controller-gen release. CRDs and RBAC have been regenerated, and "namespace" has been removed from the markers in the Patroni and pgBackRest Go files (it was no longer providing much benefit since the go code already cleanly organizes the RBAC, and changes to controller controller-gen had the potential to break RBAC generation as a result of its use). Issue: PGO-1748
These are not compatible with Red Hat's current requirements. Issue: PGO-1046
Recent controller-gen does the resource consolidation for us, and recent Kustomize can change ClusterRole to Role with a patch directive. Ruby is no longer required during development! Issue: PGO-1748
Recent controller-gen does this for us. Issue: PGO-1748
Issue: PGO-1748
The JSON patch was awkward to maintain, and we forgot to update it when we added PVCs to our APIs. I considered defining these rules on a shared Go type in our API package, but I did not like the type conversion it requires in our controller and test code. Issue: PGO-1748
This is easier to manage in one place and is the last modification we're making to CRDs as they are generated. A future commit is free to remove the Kutomiziations entirely. Issue: PGO-1046 Issue: PGO-1748
Recent versions of controller-gen are able to describe our CRDs! Issue: PGO-1748
a2f3798
to
07c46eb
Compare
Recent controller-gen does everything we had to do with Ruby and Kustomize.
This removes the
build/crd
,config/singlenamespace
, andinstallers
directories. In their place, I've added two validation rules to most of our PVC specs. The pgAdmin APIs don't have these rules, and adding them causes a test to fail.Checklist:
Type of Changes:
Other Information: