Skip to content
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

Allow setting King Konf's ignore_unknown_variables #312

Open
sean-heller opened this issue Jan 11, 2023 · 3 comments
Open

Allow setting King Konf's ignore_unknown_variables #312

sean-heller opened this issue Jan 11, 2023 · 3 comments

Comments

@sean-heller
Copy link

sean-heller commented Jan 11, 2023

When running on Kubernetes, if there are any Service objects with names that start with racecar-, invalid environment variables will be present since Kubernetes provides Service details as environment variables

This results in the error:

unknown environment variable RACECAR_XYZ_EXAMPLE (KingKonf::ConfigError)

King Konf has a setting to get around this by setting ignore_unknown_variables: https://github.com/dasch/king_konf/blob/master/lib/king_konf/config.rb#L14-L16 but we're unable to set that in racecar before it starts up.

Would it be possible to add this?

@deepredsky
Copy link
Collaborator

Racecar's config just inherits from KingKonf, so you maybe you can use that configuration by adding something like this in your initializer

Racecar::Config.ignore_unknown_variables true

@deepredsky
Copy link
Collaborator

I tested if my example would work. Unfortunately KingKonf immediately initializes configuration from ENV, even before any other configuration are loaded.

@jalford14
Copy link

@sean-heller did you ever find a solution to this? we're running into the same problem here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants