Rewrite script to generate pilot/pkg/config/kube/crd/types.go in golang#4011
Rewrite script to generate pilot/pkg/config/kube/crd/types.go in golang#4011diemtvu merged 8 commits intoistio:masterfrom
Conversation
…list of schemas directly.
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: Assign the PR to them by writing The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these OWNERS Files:You can indicate your approval by writing |
Codecov Report
@@ Coverage Diff @@
## master #4011 +/- ##
======================================
+ Coverage 76% 76% +1%
======================================
Files 297 297
Lines 27125 27164 +39
======================================
+ Hits 20498 20537 +39
+ Misses 5310 5307 -3
- Partials 1317 1320 +3
Continue to review full report at Codecov.
|
pilot/tools/types.go.tmpl
Outdated
| @@ -0,0 +1,142 @@ | |||
| // Code generated by generate.sh. DO NOT EDIT! | |||
There was a problem hiding this comment.
update this to point to the new tool please
There was a problem hiding this comment.
Really, this could/should be a //go:generate directive.
| package main | ||
|
|
||
| import ( | ||
| "bytes" |
xiaolanz
left a comment
There was a problem hiding this comment.
Thank you so much for doing it!
| } | ||
| // Tweak to match current naming. This can be changed to meet the new naming convention. | ||
| if schema.Group == "authenticaiton" { | ||
| out.IstioKind = crd.KabobCaseToCamelCase(schema.Group + "-" + schema.Type) |
There was a problem hiding this comment.
FYI I plan to do a follow up PR to generate type.go in folder apis/group/version to allow duplicate kinds.
| IstioKind: crd.KabobCaseToCamelCase(schema.Type), | ||
| CrdKind: crd.KabobCaseToCamelCase(schema.Type), | ||
| } | ||
| // Tweak to match current naming. This can be changed to meet the new naming convention. |
There was a problem hiding this comment.
Please make it a TODO(xiaolanz)
|
@diemtvu: The following tests failed, say
DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
This is to replace pilot/pkg/config/kube/crd/generate.sh. The new script can access the model schema list (ConfigDescriptor) directly so it would be easier and more flexible to construct types.go