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

Respect no_prefix for Consul keys #204

Merged
merged 4 commits into from
May 14, 2019
Merged

Respect no_prefix for Consul keys #204

merged 4 commits into from
May 14, 2019

Conversation

freddygv
Copy link
Contributor

Fixes: #190

Previously, the configuration option no_prefix was implemented for keys read from Vault but not from Consul.

This PR implements the behavior as stated in the docs:

This [noprefix] tells Envconsul to not prefix the keys with their parent "folder".

@freddygv freddygv requested review from a team and removed request for a team April 29, 2019 16:41
Copy link
Member

@banks banks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@eikenb
Copy link
Contributor

eikenb commented May 13, 2019

This changes the default behavior for Consul keys. Currently they default to having no prefix, as if no_prefix defaulted to true. This changes no_prefix's default to false, so that they would all have prefixes.

I'm afraid changing the default behavior will break existing uses.

Would it be possible to have it default to true?

@freddygv
Copy link
Contributor Author

We could have NoPrefix default to true, but then we introduce a similar issue for Vault keys.

Right now they default to including the prefix when no_prefix isn't set.

Thoughts, @banks?

@banks
Copy link
Member

banks commented May 14, 2019 via email

@freddygv
Copy link
Contributor Author

@eikenb I took a pass at allowing Consul and Vault to have different defaults for NoPrefix. This was done by not setting a default value when the config is initialized.

Now users who weren't setting that flag won't see a change in behavior.

Copy link
Contributor

@eikenb eikenb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new changes look good. I think we'll revisit this issue in the future to see if we can get the defaults in sync... but for now I like this solution.

@freddygv freddygv merged commit d9c75a3 into master May 14, 2019
@freddygv freddygv deleted the consul-noprefix branch May 14, 2019 23:16
@eikenb eikenb added this to the 0.8 milestone May 14, 2019
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

Successfully merging this pull request may close these issues.

no_prefix not working for Consul values
3 participants