Code organization round 2 including no more duplicate CRD files#35
Code organization round 2 including no more duplicate CRD files#35lauralorenz wants to merge 8 commits intokubernetes-sigs:masterfrom
Conversation
Also pulls up all changes that had been made into clusterproperty/ since 2022, which happened to all have been in that directory. Signed-off-by: Laura Lorenz <lauralorenz@google.com>
Signed-off-by: Laura Lorenz <lauralorenz@google.com>
Signed-off-by: Laura Lorenz <lauralorenz@google.com>
Signed-off-by: Laura Lorenz <lauralorenz@google.com>
Signed-off-by: Laura Lorenz <lauralorenz@google.com>
Signed-off-by: Laura Lorenz <lauralorenz@google.com>
Signed-off-by: Laura Lorenz <lauralorenz@google.com>
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: lauralorenz The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
lauralorenz
left a comment
There was a problem hiding this comment.
A few notes for context for reviewers.
| } | ||
|
|
||
| //+genclient | ||
| //+genclient:nonNamespaced |
| //+kubebuilder:resource:scope=Cluster | ||
|
|
||
| // ClusterProperty is the Schema for the clusterproperties API | ||
| // ClusterProperty is a resource provides a way to store identification related, |
| MetricsBindAddress: metricsAddr, | ||
| Port: 9443, | ||
| Scheme: scheme, | ||
| Metrics: metricsserver.Options{ |
There was a problem hiding this comment.
Struct edited because of bump to controller-runtime v0.17.0
| @@ -5,7 +5,6 @@ resources: | |||
| - bases/about.k8s.io_clusterproperties.yaml | |||
| #+kubebuilder:scaffold:crdkustomizeresource | |||
|
|
|||
| patchesStrategicMerge: | |||
There was a problem hiding this comment.
Automated changes from kustomize edit fix due to update of kustomize
| @@ -12,10 +12,6 @@ namePrefix: clusterproperty- | |||
| #commonLabels: | |||
| # someName: someValue | |||
|
|
|||
| bases: | |||
There was a problem hiding this comment.
Also all kustomize edit fix generated updates
| args: | ||
| - --leader-elect | ||
| image: controller:latest | ||
| imagePullPolicy: IfNotPresent |
There was a problem hiding this comment.
While testing easier to force it to use local image I've build/kind loaded.
| GO111MODULE=on go install "k8s.io/code-generator/cmd/client-gen" | ||
| GO111MODULE=on go install "k8s.io/code-generator/cmd/lister-gen" | ||
| GO111MODULE=on go install "k8s.io/code-generator/cmd/informer-gen" | ||
| GO111MODULE=on go install "sigs.k8s.io/controller-tools/cmd/controller-gen@v0.16.5" |
There was a problem hiding this comment.
Lots of back and forth trying not to update controller-gen but in the end I did have to since go.mod had already updated apimachinery and client-go to v0.29.1 and there were incompatabilities; also pinned the others to 0.29.1 based on recommendation from gemini for compatibility with go 1.22 (which is our current min version)
| @@ -1,69 +1,81 @@ | |||
| module sigs.k8s.io/about-api | |||
There was a problem hiding this comment.
Module should be sigs.k8s.io/about-api actually.... will have to come back for this one
There was a problem hiding this comment.
By “come back for this one”, do you mean revisit in a later PR, or revisit in an update to this PR? I would rather avoid such an intrusive change in this PR.
There was a problem hiding this comment.
I wasn't committed to either way but I will follow your advice and do it separate, though I have started. I have a separate branch, one can see the diff with this branch at lauralorenz#1 for convenience. It's getting a little hairy over there because the v1alpha1 codegen is a lot pickier about paths, so it's best to have it for a later time anyways.
There was a problem hiding this comment.
Oh, I meant I’d rather fix the module name in this PR!
There was a problem hiding this comment.
I've got this change now in another-another branch, visible at lauralorenz#2, but it's pretty big and I'm not 100% sure all of the code generation is correct but I could use a new set of eyes on it.
There was a problem hiding this comment.
Riffing off that branch, I’ve updated the codegen and the clientset/informers etc. are now correct: https://github.com/skitt/about-api/tree/code-organization-round-2b
There was a problem hiding this comment.
- Could cherry pick this into this branch <== i will do this
- Could merge this and then stephen open a PR
|
/hold Per SIG-MC discussion 3/10, I'm addressing the module path concern in #35 (comment), and likely collapsing the separate codegen formats into one for sanity, before looking for any more reviews on this right now. |
|
This looks pretty good to me overall happy to leave a lgtm once the go.mod thing / this "sub PR" lauralorenz#2 have been sorted out 🎉! Thanks Laura for the work and for splitting this in comprehensive commits and leaving some context comments about a few changes 🙏 |
|
TODO:
|
This PR
clusterproperty/directory that had not been elevated to the root directory during PR Organizes API structure and enable Go module #12config/directories,main.goand the other controller files,DockerfileandMakefiledid not get moved out into the root folder, assumedly because they are all only useful/used by the controller so were not immediately important to users of the CRD. Also ONLY the output CRD yaml came out ofconfig/crd, not any of the other coexisting stuff, which includes the ways to add kustomize patches, the most important of which (for now at least) is the k8s.io protection patch since IIRC the CRD should be rejected by API server as invalid when applied without it.clusterproperty/directory over the past few PRs of theirs (including to the Makefile, Dockerfile, and types) and by @qiujian16 and @RainbowMango to thepkg/apis/v1alpha1version. I did this by going commit by commit through https://github.com/kubernetes-sigs/about-api/commits/master/clusterproperty and https://github.com/kubernetes-sigs/about-api/commits/master/pkg since 2022 and personally making sure those changes were incorporated. (All other files had not been touched in 4+ years and since prior to the code reorganization in Organizes API structure and enable Go module #12, or were not going to be touched by this change, like OWNERS).make run,deploy/undeploy,install/uninstall,docker-buildandmanifests/generate.make test, but I think this is good enough on its own and we can follow on with that./hack/update-codegen.shkind of pattern) and one for v1beta1 (controller-runtime CLI based). I've left them both in for now and the Makefile does both, but I think that could be the next thing to tidy up.Fixes #28