Skip to content
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

should -template validate configuration? #468

Open
tgross opened this issue Aug 8, 2017 · 0 comments
Open

should -template validate configuration? #468

tgross opened this issue Aug 8, 2017 · 0 comments

Comments

@tgross
Copy link
Contributor

tgross commented Aug 8, 2017

The notion of ContainerPilot having a -validate command came up in a sidebar discussion between @geek and @cheapRoc and myself. Currently you can use the -template subcommand to render the template, but it only does the template rendering and doesn't even make sure the configuration is syntactically valid.

A hypothetical -validate command would have to render the template anyways, because otherwise there's no guarantee that the configuration file is syntactically valid. So it seems like the cleanest way to handle this would be to have the -template subcommand also validate that the ContainerPilot configuration is valid.

In terms of the implementation, this would make it so that RenderConfig calls LoadConfig and then renders the output. This would eliminate a bunch of duplicated code in RenderConfig too.

My major concern with this is that currently an invalid configuration will render just fine with -template, and this changes the behavior in an error condition. On the other hand, right now someone can render a bad template and the only find out when they try to reload that config, which will get them an error anyways.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant