hashicorp / hashicorp/consul-template
consul-template overrides CONSUL_HTTP_SSL env variable in exec
- Dominant language
- Go
- Stars
- 4.8k
- Forks
- 801
- Avg merge
- 4h 5m
- Merged PRs (30d)
- 6
Description
### Consul Template version
```
consul-template -v
consul-template v0.19.0 (33b34b3)
```
### Configuration
```shell
server> CONSUL_HTTP_SSL=true consul-template -once -template f.ctpl:res.ctp -exec "env" | grep "CONSUL_HTTP_SSL"
CONSUL_HTTP_SSL=true
CONSUL_HTTP_SSL=false
CONSUL_HTTP_SSL_VERIFY=true
```
f.ctpl is empty file (no need to render)
### Expected behavior
According to doc: https://github.com/hashicorp/consul-template#command-environment I see:
These environment variables are exported with their *current* values
So I expect CONSUL_HTTP_SSL is NOT changed if it is already set
### Actual behavior
CONSUL_HTTP_SSL was chaned from `true` to `false`
### Additional info
I use consul-template running another consul templtae:
```
export CONSUL_ADDRESS=server:443
export CONSUL_HTTP_SSL=true
```
```
consul-template -once -template file.ctpl:config.conf -exec "some-script.sh"
```
and some-script.sh called consul-template to render another configs and failed because trying to use http instead of https
Output of inner consul-template call looks like:
```
10 [WARN] (view) kv.block(some-block): Get http://consul-server:443/v1/kv/...
```
Contributor guide
Assessment
This issue has not been assessed yet.