-
Notifications
You must be signed in to change notification settings - Fork 93
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
Added OpenAPI Codegen #474
Conversation
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.
2 more comments but otherwise looks good and worked fine in rancher/rancher to generate OpenAPI documents of types.
@tomleb You were right, I worked to adjust both gengo and kube-openapi to compatible version and it worked! Thank you! |
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.
Looks good! Had just a couple of very small questions...
@@ -95,6 +95,7 @@ func (cg *ClientGenerator) typesGroupVersionDocPackage(name *types.Name, gv sche | |||
p.HeaderComment = []byte(fmt.Sprintf(` | |||
%s | |||
|
|||
// +k8s:openapi-gen=true |
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.
We should make this dependent on the GenerateOpenAPI flag.
I thought we were okay with just doing the same as deepcopy but I misunderstood that deepcopy is generated when this generator runs..
It will also prevent having a huge amount of file changes in rancher/rancher when we update wrangler. (And also will prevent any change in behavior due to that new directive)
Could you make that change? Sorry about this.
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.
Just a couple of cosmetic changes related to errors
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
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.
Tested it in r/r and code with the flag off don't modify current generated code and when the flag is on it does generate properly.
This is related to issue: 47007