feat(cli): support reserved environment variable "APISIX_DEPLOYMENT_E…#8898
Conversation
|
|
||
| local function replace_by_reserved_env_vars(conf) | ||
| -- TODO: support more reserved environment variables | ||
| local v = getenv("APISIX_DEPLOYMENT_ETCD_HOST") |
There was a problem hiding this comment.
Since it's an array, let's call it APISIX_DEPLOYMENT_ETCD_HOSTS.
There was a problem hiding this comment.
Perhaps it is a better idea that the variable name matches the configuration item?
deployment:
etcd:
host:
- xxx
=======
APISIX_DEPLOYMENT_ETCD_HOST
It's easier to be understood, and there is no need to add more detailed documents to describe this feature.
| exit 1 | ||
| fi | ||
|
|
||
| out=$(APISIX_DEPLOYMENT_ETCD_HOST='["http://127.0.0.1:2333"]' make run 2>&1 || true) |
There was a problem hiding this comment.
Can you configure a connectable address and check if it works?
spacewander
left a comment
There was a problem hiding this comment.
It seems this feature is broken, when I tried "valid host in env" + "invalid host in conf" + "make run".
@spacewander This case is covered by the latest commit and passed. |
I spend some time playing with this feature locally. Look like when APISIX is running, it will read the env variable in a different path. The CI stops APISIX too early, so APISIX doesn't have time to read it. |
| env PATH; # for searching external plugin runner's binary | ||
|
|
||
| # reserved environment variables for configuration | ||
| env APISIX_DEPLOYMENT_ETCD_HOST; |
There was a problem hiding this comment.
Can we find a way to cover it in the CI? So we don't need to spend time verifying it locally next time.
…TCD_HOST"
Description
The user can use env variable "APISIX_DEPLOYMENT_ETCD_HOST" to config the etcd.host.
Priority: env var > config.yaml
Checklist