-
Notifications
You must be signed in to change notification settings - Fork 0
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
feat: Render config.go
(first stage) and improvements in rendering entry.go
#35
Conversation
…d functions used in templates
… the issues from `golangci-lint run --enable-all`
…hich from now is used also in config.tmpl
# Conflicts: # pkg/translate/funcs.go
During review, please take a look especially on:
Note - currently that function is also generating functions to compare |
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.
After internal testing I found some issue which was resolved by @sebastianczech here:
0235c2a
52d26ef
Overall very great approach!
We agreed to push forward with known issues:
- tags color (to be defined based on the separated struct, in tag.yaml it is implemented already)
- function in entry.tmpl
MarshalXML
currently if we specified version to the iefqdn_refresh_time
parameter instruct/dns.yaml
it will generate with attribute related to the versioned struct, which in summary create missing parameter (because MarshalXML is c configXML where this variable don't exists)
Also, there was an topic related to the duplication in generated code, and to handle this case after some testing I found 2 solution we can try:
- use Reflect library to create complex dynamic structure
- use a lot of custom logic with struct merges
either of this approaches could take a long time to figure it out the best approach, so we agreed that we will move forward with that approach that we have right now, and we tackle this issue later.
Description
PR delivers generation of
config.go
(first stage) for objects, which are not entries (like NTP settings).Moreover it introduces improvements in rendering
entry.go
:Motivation and Context
entry.go
#30config.go
#37SpecMatches()
inentry.go
#38CopyMiscFrom
inentry.go
#39How Has This Been Tested?
Automated tests are part of PR.
Moreover
entry.go
generated for address and service was checked directly with the firewall in the cloud.Types of changes
Checklist