Closed LordBrain closed 7 years ago
Hi @blee1170
Thank you for opening an issue. This is behaving as intended. The keyOrDefault
function attempts to read a key in Consul. If no key exists at that path, the default value is rendered instead. However, a failure to connect to Consul or Vault is always an error. You can control retries globally or on a per-template basis using the retry
stanza. Thanks! 😄
Hi @sethvargo
Our use case might be a little unique, but it might also be useful for other people. It would be nice to pass a flag to allow the default to render even if it can not talk to consul. In our case we want to validate that the files get placed when we create a RPM, but before its deployed to any environment, hence we are getting the connection refused
.
Can we turn this into a feature request?
Hi @blee1170
Consul Template's architecture doesn't allow for this kind of behavior, and implementing such a feature would require a massive refactor of the codebase and internal data flow.
That doesn't mean it still cant be a feature request. Sometimes people will want to render a file using consul template using just environment variables. This will be a nice feature to have.
Consul Template version
0.18.3
Configuration
Command
Debug output
Expected behavior
Consul-template would render the file with the default key.
Actual behavior
Consul template does not render the file. Which causes testing to fail.
Steps to reproduce
References