vault
vault copied to clipboard
Vault injects missing variable as a variable with <no_value> string value
We use vault to inject variables into containers, like this:

When the variable "SOME_VAR" is missing from the vault UI, it is being injected as variable with "<no_value>":

Why is it happening? Shouldn't it be skipped somehow?
Please see https://github.com/hashicorp/consul-template/issues/972 for discussion on this topic.
Hi there!
Going to close this - as discussed in https://github.com/hashicorp/consul-template/issues/972 (thanks maxb for linking that!) - there are two ways to change this behaviour:
- Use the
error_on_missing_keyconfiguration Vault Agent: https://developer.hashicorp.com/vault/docs/agent/template#error_on_missing_key - Use another
withclause to ensure the Data is there: e.g.{{ with .Data.b }}
Thanks! Violet