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
Generate CRDs with structural schema #1885
Conversation
Signed-off-by: Adnan Abdulhussein <aadnan@vmware.com>
Signed-off-by: Adnan Abdulhussein <aadnan@vmware.com>
Signed-off-by: Adnan Abdulhussein <aadnan@vmware.com>
Signed-off-by: Adnan Abdulhussein <aadnan@vmware.com>
@prydonius are you looking for input on this yet? I haven't looked yet but can if you're wanting feedback |
Thanks @skriss, would be great if you could take a look at the code generation, though so far I'm still testing the schema validation with different clusters, and need to finish making the changes to the optional API fields and push that up. |
pkg/generated/crds/crds_generate.go
Outdated
@@ -0,0 +1,117 @@ | |||
// +build ignore |
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 LGTM - only thing I'm wondering is if we want to relocate this file to be outside of pkg/generated
? It could make sense to go in a subdir of hack
.
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.
Yeah, I was thinking about that too - I think that makes sense, will move it there.
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.
I think this was moved to hack/crd-gen/main.go
and this needs to be deleted?
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.
yep 😅thanks for the catch!
Signed-off-by: Adnan Abdulhussein <aadnan@vmware.com>
Signed-off-by: Adnan Abdulhussein <aadnan@vmware.com>
I'm going to make the API type changes in a different PR as it's just going to be easier to review. The current CRDs are broken due to non-optional status fields, so I've reverted the |
@carlisia ptal if you have a chance! |
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.
A nit + I think a file needs to be removed but else great work figuring this out! 💯
|
||
// This code embeds the CRD manifests in pkg/generated/crds/manifests in | ||
// pkg/generated/crds/crds.go. | ||
|
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.
Nit: I would delete this line
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.
Hmm, most other files have an empty line between the comment and package name (unless documenting what the package is for), so probably best to keep that consistent?
pkg/generated/crds/crds_generate.go
Outdated
@@ -0,0 +1,117 @@ | |||
// +build ignore |
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.
I think this was moved to hack/crd-gen/main.go
and this needs to be deleted?
Signed-off-by: Adnan Abdulhussein <aadnan@vmware.com>
Signed-off-by: Adnan Abdulhussein <aadnan@vmware.com>
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.
LGTM - this should be ready for merge, right?
* upstream/master: (38 commits) sync controller: replace revision file with full diff each interval (vmware-tanzu#1892) Increment logging for item backupper (vmware-tanzu#1904) Add LD_LIBRARY_PATH as an env varible for the use of vsphere plugin (vmware-tanzu#1893) Remove unused flag (vmware-tanzu#1913) Use layers in the builder Dockerfile (vmware-tanzu#1907) Fix for vmware-tanzu#1888: check item's original namespace, not remapped one, for inclusion/exclusion (vmware-tanzu#1909) fail on make verify if generated CRDs differ (vmware-tanzu#1906) velero API type changes for structural schema CRDs (vmware-tanzu#1898) Generate CRDs with structural schema (vmware-tanzu#1885) Plan for moving plugin repos (vmware-tanzu#1870) move plugin proto updating into make update (vmware-tanzu#1887) Add features package (vmware-tanzu#1849) GCP: support specifying Cloud KMS key name for backup storage locations (vmware-tanzu#1879) Adds to website (vmware-tanzu#1882) proposal for generating Velero CRDs with structural schema (vmware-tanzu#1875) Improve contributing docs (vmware-tanzu#1852) [doc] Diagram (image) now mentions velero (vmware-tanzu#1877) AWS: add support for arbitrary SSE algorithms, e.g. AES256 (vmware-tanzu#1869) update restic docs for PR vmware-tanzu#1807 (vmware-tanzu#1867) changelog for PR vmware-tanzu#1864 ...
This PR introduces CRD generation using the controller-tools tooling. The CRDs are generated to a manifests folder, and a custom code generator is used to embed the manifests in a Go pkg and make them retrievable as API objects.
Signed-off-by: Adnan Abdulhussein aadnan@vmware.com