Configure -once via config.hcl
Opened this issue · 3 comments
Envconsul version
envconsul v0.10.0 (1835ce9)
Configuration
once = true
Command
envconsul -config /etc/envconsul.hcl
Debug output
2020/10/28 09:56:29 [ERR] (cli) from file: /etc/envconsul.hcl: mapstructure decode failed: 1 error(s) decoding:
* '' has invalid keys: once
Expected behavior
What should have happened?
envconsul should start the same way it would do as with "-once" parameter
Actual behavior
What actually happened?
envconsul crash with the reason that "once" is not a valid config entry.
Steps to reproduce
- create a config where once = true
- start envconsul with this config
- envconsul crashes
References
Are there any other GitHub issues (open or closed) that should be linked here?
For example:
- GH-1234
- ...
Hey @Skaronator, thanks for taking the time to submit this issue.
We are trying to standardize our various tools cli/config options around the ideas that cli options control the binary behavior where the config options control the application behavior. This means we really don't want to add a once
config option.
I would like to ask what issue you are trying to solve with this request? In case we might have some alternative solutions to offer.
Hi @eikenb, I'm trying to configure envconsul in only one place. At first I was using only the CLI parameters in my Dockerfile which was fine until I had to set consul.retry.max_backoff
which doesn't seem to be available as CLI parameter. So I had to switch to the config file and moved all my CLI Paramters in that config file to have everything on one place but as it turns out I cannot set the -once flag via config.
Now we have this config file but everyone else in the team need to remember that this one option is set in the Dockerfile and not in the configuration with the rest of envconsul. :/
I would highly appreciate to have all config option available as CLI parameter as well as config file parameter.
Does the software you are running with exec support exiting after its run? If the exec'd program exits, envconsul doesn't try to restart it and exits as well.