community icon indicating copy to clipboard operation
community copied to clipboard

Replace hard-coded use cases with templates in code-generator

Open brycahta opened this issue 3 years ago • 4 comments

Summary

Logic for ACK's use case is hard-coded in functions related to Go code generation. For example, ack prefix is used in late_initialize.go and ackerrors are used in set_resource.go. The solution is to abstract these hard-coded values into templates and expose them as new configs in ackgenconfig so users can input paths to their template files in generator.yaml

Context

The proposal detailing the approach can be found here.

Implementation

  • [ ] Abstract hard-coded logic out of late_initialize.go into a template
  • [ ] Create a new ackgenconfig so users can provide template in generator.yaml
  • [ ] Add relevant test(s) and test locally with a service controller using late initialize feature
  • [ ] Repeat for remaining hard-coded areas: ACKResourceMetadata, ackerrors, crd.go.tpl

brycahta avatar Mar 02 '22 16:03 brycahta

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

ack-bot avatar May 31 '22 17:05 ack-bot

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

ack-bot avatar Jun 30 '22 17:06 ack-bot

/lifecycle frozen

vijtrip2 avatar Jun 30 '22 17:06 vijtrip2