exporter-toolkit icon indicating copy to clipboard operation
exporter-toolkit copied to clipboard

Add Config to FlagConfig struct

Open peppi-lotta opened this issue 6 months ago • 8 comments

This refactoring allows the Serve function to be called without requiring a YAML configuration file. As a result, the function becomes easier to use from other projects, since configuration is no longer tied to an external YAML file.

The change was proposed in PR #7255 to the CoreDNS project. To maintain backward compatibility while enabling this flexibility, I added a Config field to the FlagConfig struct. This approach preserves the existing behavior while allowing external projects to inject configuration directly.

peppi-lotta avatar Jun 30 '25 13:06 peppi-lotta

@SuperQ Here's my proposed change to enhance FlagConfig so it can accept either a config file path or a Config object. This change maintains existing functionality, but makes the code easier to integrate from other codebases.

Let me know if this aligns with your vision for the refactor. I'm happy to adjust the implementation in any way if needed.

peppi-lotta avatar Jul 03 '25 10:07 peppi-lotta

@SuperQ can we have some review on this? It would be good to get this one rolling

kashifest avatar Jul 14 '25 07:07 kashifest

Thanks for the PR! As right now this is either config struct or file based, do we see a use case where an app wants to set certain defaults via the config struct and have the user overwrite it via the file?

mrueg avatar Jul 14 '25 22:07 mrueg

I think the either config or file is fine. We don't need a combo.

SuperQ avatar Jul 15 '25 07:07 SuperQ

@mrueg I have now added a function for validating the config. Could you please take a look and provide a review when you have a chance?

peppi-lotta avatar Jul 21 '25 06:07 peppi-lotta

@mrueg Could we get a review on this?

nuhakala avatar Aug 05 '25 09:08 nuhakala

@mrueg @SuperQ Please let me know if there is something I can do to move this forward :)

peppi-lotta avatar Sep 01 '25 10:09 peppi-lotta

@mrueg @SuperQ Please review these changes or let me know who I can ping for review :)

peppi-lotta avatar Sep 26 '25 06:09 peppi-lotta