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

datasource vault returns an empty map #1228

Closed
zhilyaev opened this issue Oct 9, 2021 · 6 comments
Closed

datasource vault returns an empty map #1228

zhilyaev opened this issue Oct 9, 2021 · 6 comments

Comments

@zhilyaev
Copy link

zhilyaev commented Oct 9, 2021

Versions

  • gomplate version 3.10.0
  • gomplate version 3.9.0

I have

vault kv get -field=key  secret/test/example                                                                                                                                    
value

I do

gomplate -d vault=vault:///secret/test/example -i '{{(ds "vault")}}'
map[] 

gomplate -d vault=vault:///secret/test/example -i '{{(ds "vault").key}}'                                                                                                         
23:02:48 ERR  error="failed to render template <arg>: template: <arg>:1:6: executing \"<arg>\" at <\"vault\">: map has no entry for key \"key\""

I expect

gomplate -d vault=vault:///secret/test/example -i '{{(ds "vault").key}}'
value
@hairyhenderson
Copy link
Owner

@zhilyaev can you provide more information about your environment? How are you authenticating to Vault? What environment variables do you have set when you're running gomplate? And - are you certain that the Vault role that gomplate is authenticated with has read permissions set correctly for that path?

@zhilyaev
Copy link
Author

zhilyaev commented Oct 11, 2021

@hairyhenderson

I use classic environment variables VAULT_ADDR and VAULT_TOKEN

@zhilyaev
Copy link
Author

zhilyaev commented Oct 11, 2021

I have the same

gomplate -d vault=vault://vault.my.local/secret/test/example -i '{{(ds "vault")}}'
map[]%

Also datasourceReachable returns true.

@hairyhenderson
Copy link
Owner

What version of Vault?

What is the policy attached to the vault token that you're using?

Can you reproduce with vault running locally in dev mode? This might make it easier to track down exactly what's going on.

@zhilyaev
Copy link
Author

@hairyhenderson
image

@hairyhenderson
Copy link
Owner

Ahh... this is using Vault's K/V v2 endpoint, which has slightly different semantics. Unfortunately, gomplate doesn't fully support that yet. See #862 for details.

I'm going to close this, since #862 is already tracking this issue. If you believe this is not the problem, feel free to re-open and specify why this is different.

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

2 participants