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

Env backend support for keys with underscore #567

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

stela
Copy link

@stela stela commented Jun 2, 2017

This patch allows underscores in paths, even when the "env" backend is used. See #531.

I attempted to add the key-value combinations for all the backend integration tests, but didn't actually run them yet myself besides for the "env" backend. The formats I saw didn't give me reason to suspect underscores aren't handled like other alphanumeric values in other backends, hope that's correct.

@nvanheuverzwijn
Copy link

This is a better solution than this #541

Nice work

@Danno040
Copy link

So, there's still a "gotcha" with this solution when using prefix for loading a group of keys.

For example, this will fail:

basic.toml

[template]
mode = "0644"
src = "basic.conf.tmpl"
dest = "/tmp/confd-basic-test.conf"
keys = [
  "/database",
]

basic.conf.tmpl

host={{getv "/database/host"}}
port={{getv "/database/user_name"}}

Because everything after the prefix gets "cleaned", the result of GetValues will look like:

map[string]string{"/database/user/name":"something", "/database/host":"host"}

Maybe a minor problem, but worth pointing out.

@okushchenko okushchenko added this to the 0.14.0 milestone Aug 22, 2017
@okushchenko okushchenko removed this from the 0.14.0 milestone Oct 9, 2017
@stela stela mentioned this pull request Feb 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants