Config options like -once are not respected if set in a config file as they are always overwritten by their values (default or explicitly given) coming from the command line option. This makes their use in a config file meaningless.
For example for file consul-config-true.hcl:
running
consule-template -config consul.config-true.hcl
will not take into account once = true set in the config file even though there isn't an explicitly set -once=false as a command line argument. In order for this to work any such flags if not specified explicitly in the command line should be set to nil first and at the end of constructing the config should be set to its default value (false) only if it is still nil then.
This most likely applies to other such options but I've tested this only with -once.
Still not sure whether this is a bug or the intended behavior even though then once is meaningful only as a command line flag and not in a config file.
Config options like
-onceare not respected if set in a config file as they are always overwritten by their values (default or explicitly given) coming from the command line option. This makes their use in a config file meaningless.For example for file consul-config-true.hcl:
running
consule-template -config consul.config-true.hclwill not take into account
once = trueset in the config file even though there isn't an explicitly set-once=falseas a command line argument. In order for this to work any such flags if not specified explicitly in the command line should be set tonilfirst and at the end of constructing the config should be set to its default value (false) only if it is stillnilthen.This most likely applies to other such options but I've tested this only with
-once.Still not sure whether this is a bug or the intended behavior even though then
onceis meaningful only as a command line flag and not in a config file.