-
Notifications
You must be signed in to change notification settings - Fork 187
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
Code generator change for member of type list #452
base: main
Are you sure you want to change the base?
Conversation
Currently code generator assumes the type of 'member' as scalar. But if the member is a list, the generated code needs to be as per that type.
Hi @nnbu. Thanks for your PR. I'm waiting for a aws-controllers-k8s member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions 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. |
This change was needed to generate correct code for PR: aws-controllers-k8s/ec2-controller#138 This PR is for adding flowlog feature in ec2 controller. CreateFlowLogs api returns a list of flowlogIDs. So, the generated code in file pkg/resource/flow_log/sdk.go needs to looks like following (notice '...' in generated code 'r.ko.Status.FlowLogIDs...' ):
} But currently without my change in code-generator, the generated code does not add '...' and so compilation in the generated code fails. |
cleanFieldNames := names.New(fieldName) | ||
pathFieldName := cleanFieldNames.Camel | ||
|
||
if _, ok := r.Fields[pathFieldName]; ok { |
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 is fine for now, but note that this will not handle nested fields, since the path isn't being built up and only contains the member name. We can cross that bridge when we get to it, though... :)
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.
@nnbu can you add a comment to IsMemberList
stating what is can currently do and it's limitations? maybe a //TODO stating what needs to be added.
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: jaypipes, nnbu The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/ok-to-test |
/retest |
1 similar comment
/retest |
/test all |
@nnbu could you please address this #452 (comment) - i would like to merge this soon |
/test all |
@nnbu: The following tests failed, say
Full PR test history. Your PR dashboard. Instructions 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. |
Currently code generator assumes the type of 'member' as scalar. But if the member is a list, the generated code needs to be as per that type.
Issue #, if available:
Description of changes:
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.