Open gusinacio opened 2 weeks ago
Hi, small doubt, .merge(Env::prefixed(prefix.get_prefix()).split("__"))
it should be overriding previous default values read from default_config.toml right?
Yes, this Env step is the last one, it should overwrite all other steps.
Priority (higher to lower):
.merge(Env::prefixed(prefix.get_prefix()).split("__"))
)envsubst
)--config
)Sorry for making trouble again but one more doubt, so what am i missing here, if the user does not provide any environment variables then it'll go for default values right?
Hey, no worries, ask as many questions as you need.
What I expect is what docker-compose
currently have https://docs.docker.com/compose/how-tos/environment-variables/variable-interpolation/#interpolation-syntax for default values.
- Default value
- ${VAR:-default} -> value of VAR if set and non-empty, otherwise default
- ${VAR-default} -> value of VAR if set, otherwise default
Some deployment scripts might want to have default values in case their users don't provide an environment variable. We need to update our config environment replacer to check for environment variables and use the default value if none is provided.
For a future PR: we should ignore default variables or let the user know that we don't support it.
_Originally posted by @gusinacio in https://github.com/graphprotocol/indexer-rs/pull/344#discussion_r1791840058_