-
Notifications
You must be signed in to change notification settings - Fork 385
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature Suggestion — Check arbitrary keys/values #126
Comments
PR submitted. Suggestions welcome. |
I don't understand the requirement. If you want to protect against forgetting to add the environment variables in production, can't you simply mark the fields as |
@CAFxX We do that, but the issue we have is that we have to start up the service with each environment's config file in order to see the missing values. And in some cases we'd rather not start a service with production config, as it might start consuming from queues, for example. |
Wouldn't having a dry-run/config validation flag that instructs the process to exit immediately after parsing its configuration be the simple and easy solution, then?
Alternatively, why can't you produce a parseable dump of the list of known envvars using |
I had some feedback on the PR, but @CAFxX you're way ahead of me here. Great suggestions, thank you. |
I work in a team that uses docker-compose. Commonly, we have docker-compose.yml files for each of our environments. It's a fairly common issue that we define new environment variables for a service, but forget to include them in the production environment's compose file, since it doesn't tend to be used locally.
I don't propose to make envconfig aware of docker compose, but I would like a way to 'check' an arbitrary set of keys/values against a spec. I can put together a tool to get the environment variables from the docker-compose file, but I can't currently pass those in to envconfig. Would you be open to adding a
Check(prefix string, spec interface{}, kvs map[string]string)
method? I'd be happy to submit a PR for it.The text was updated successfully, but these errors were encountered: