community
community copied to clipboard
Code redeclarations happen if resource and shape names overlap
Is your feature request related to a problem?
When generating crossplane controller code for a service it uses the scheme Generate + shape name to generate methods for preparing inputs and processing outputs. If some shapes have the same name as the resource itself it generates methods with overlapping names. (e.g. for cognitoidentity we have the resource IdentityPool and the shape IdentityPool used as input for update calls.
Describe the solution you'd like It would be useful to have the option to change the way how the method names are generated (e.g. configure a prefix or suffix)
Describe alternatives you've considered
I have tried several configs that didn't habe any effect (resources.IdentityPool.update_operation.custom_method_name and operations.UpdateIdentityPool.custom_implementation). Current workaround is to disable the code generator and change the code manually
@muvaf @haarchri Do you have any ideas how to solve this issue?
Hi @Benedikt1992! The way we handle this in ACK's code-generator is to append the suffix _SDK to shapes that overlap with publicly-defined names in CRDs.
When I get back home from Spain (currently sitting in airport in Valencia...) I will generate the Cognito controller and advise you what you need to do in the generator.yaml file to get around your issue. Thanks for your patience!
Any update here?
No, we generated the code, disabled the generator and made manual changes to the code
Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.
If this issue is safe to close now please do so with /close.
Provide feedback via https://github.com/aws-controllers-k8s/community.
/lifecycle stale
Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.
If this issue is safe to close now please do so with /close.
Provide feedback via https://github.com/aws-controllers-k8s/community.
/lifecycle rotten
Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen.
Provide feedback via https://github.com/aws-controllers-k8s/community.
/close
@eks-bot: Closing this issue.
In response to this:
Rotten issues close after 30d of inactivity. Reopen the issue with
/reopen. Provide feedback via https://github.com/aws-controllers-k8s/community. /close
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.