cn-infra icon indicating copy to clipboard operation
cn-infra copied to clipboard

Generate config samples

Open ondrej-fabry opened this issue 6 years ago • 0 comments

All of the config samples (*.conf files) that we currently have were written mostly by hand. And it's very likely that most of them are probably quite out of date. It is definitely little insane to continue updating config samples manually.

This issue was created to track progress of solving this by automating and unifying generation of config sample files. Any problems related to config samples that have occurred in the past should be first resolved. For example, there has been few cases, when field name in the config sample had a typo (- vs. _), thus being unrecognized and ignored during parsing.

Following points should be addressed:

  • field names, default values and comments should be extracted from the config struct
  • structs used for config definitions should be taken as the only source of information and should be used as input for generation
  • go:generate directives could be used together with marking Config struct so it can be recognized by generation tool (similarily to Stringer tool)
  • ?

Open for discusssion..

ondrej-fabry avatar Nov 21 '19 14:11 ondrej-fabry