Skip to content

feat: support resolve default value when environment not set#5675

Merged
spacewander merged 11 commits into
apache:masterfrom
kevinw66:env_default_val
Dec 6, 2021
Merged

feat: support resolve default value when environment not set#5675
spacewander merged 11 commits into
apache:masterfrom
kevinw66:env_default_val

Conversation

@kevinw66

@kevinw66 kevinw66 commented Dec 2, 2021

Copy link
Copy Markdown
Contributor

Thanks for review my first pull request for apisix.
And this is my first time use lua. Give me some advices if possible, thanks.

This is about read default value when ENV not set, I think this may helpful when using k8s in different environment and did not want to set so many ENV variable

result:
etcd.host = http://${{ETCD_HOST}}:2379

image

etcd.host = http://${{ETCD_HOST:123ss}}:2379
image

etcd.host = http://${{ETCD_HOST:123ss:123aa}}:2379
image

Comment thread apisix/cli/file.lua Outdated
Comment thread t/cli/test_main.sh Outdated
Comment thread t/cli/test_main.sh Outdated
Comment thread t/cli/test_main.sh Outdated
Comment thread t/cli/test_main.sh Outdated
Comment thread conf/config.yaml Outdated
Comment thread apisix/cli/file.lua Outdated
@kevinw66

kevinw66 commented Dec 5, 2021

Copy link
Copy Markdown
Contributor Author

BTW, Can you help me to check the ut? I'm confusing about the error log, and it cannot run in my local machine right now.

@spacewander

Copy link
Copy Markdown
Member

Solving with #5699

Comment thread t/cli/test_main.sh Outdated
@moonming

moonming commented Dec 6, 2021

Copy link
Copy Markdown
Member

@kevinw66 great work 👍

@spacewander
spacewander merged commit a65aa09 into apache:master Dec 6, 2021
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

Successfully merging this pull request may close these issues.

4 participants