diaosj opened a new issue #3017:
URL: https://github.com/apache/apisix/issues/3017


   ### Issue description
   I noticed that version v2.1 supports environment variables in the 
configuration file: https://github.com/apache/apisix/pull/2743.
   
   I wrote these lines below to `conf/config.yaml`:
   ```yaml
   etcd:
     host:
       - "http://${{ETCD_HOST}}:2379";
     prefix: "/apisix"
     timeout: 30
     tls:
       verify: false
   ```
   
   I run the docker image with the corresponding environment variable and 
config file as below:
   ```bash
   docker run -e TZ=Asia/Shanghai -e ETCD_HOST=`ipconfig getifaddr en0` -p 
9080:9080 -p 9443:9443 -v 
`pwd`/conf/config-default.yaml:/usr/local/apisix/conf/config-default.yaml -v 
`pwd`/conf/config.yaml:/usr/local/apisix/conf/config.yaml -v 
`pwd`/plugins:/usr/local/apisix/apisix/plugins -v 
`pwd`/logs/error.log:/usr/local/apisix/logs/error.log apache/apisix:2.1-centos
   ```
   
   Then I call the admin API. But the response is like this: 
   ```json
   {
       "error_msg": "invalid http host: http://${{ETCD_HOST}}:2379, err: not 
matched"
   }
   ```
   
   I searched for this message in the repository. This message looks like from 
here: 
https://github.com/api7/lua-resty-etcd/blob/master/lib/resty/etcd/v3.lua#L155
   It seems like that etcd client still use "${{ETCD_HOST}}" literally when 
admin API is called.
   
   ### Environment
   
   * apisix version (cmd: `apisix version`): 2.1
   * OS: docker image (apache/apisix:2.1-centos)


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to