-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
consul kv command does not pass CONSUL_HTTP_TOKEN #2566
Comments
Note: This issue will also appear for CONSUL_HTTP_ADDR env variable as well. |
For me, CONSUL_HTTP_ADDR works fine. I'm helping some developers get access to our Consul system from their workstations, and I have them pull a temporary Consul token from Vault, then set their environment to talk to a reverse proxy I've set up to allow VPN access to the Consul HTTP API, so the actual workflow I get is:
There's no Consul agent running on my machine, as you can see in the first attempt to run the command without the |
Same issue with |
For completeness, the following commands don't currently respect the
These commands always set the
The complete set of changes required are reflected here. |
These be fixed by #2717, which will centralize handling of the CLI options and environment variable handling. |
consul version
Client:
0.7.1
Server:
n/a
Operating system and Environment details
Ubuntu 16.04
Description of the Issue (and unexpected/desired result)
From
consul kv get --help
:So, I expect the following two commands to have equivalent behavior:
However, the first command with
-token xyz
specified as a CLI option, passes the token to the API correctly, whereas the second command with the environment variable only does not pass the token to the API.Reproduction steps
Use netcat to verify, first, on a machine not running Consul, set netcat to listen to port 8500:
Then in another window, run the first command above. It will hang, but in the netcat terminal you can see the HTTP request that is sent:
Hit Ctrl-C on the Consul command. This will also kill the netcat process. Restart netcat, and run the second command using the environment variable, and in the netcat window you will see:
In other words,
consul kv
command does not pass through theCONSUL_HTTP_TOKEN
environment variable to theX-Consul-Token
header as the documentation suggests.The text was updated successfully, but these errors were encountered: