File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -39,6 +39,31 @@ echo "passed: define custom shdict"
3939
4040git checkout conf/config.yaml
4141
42+ # resolve environment variable used as a config key: the resolved key must be
43+ # rendered and the stale unresolved key must be removed from the config table
44+ echo '
45+ nginx_config:
46+ http:
47+ custom_lua_shared_dict:
48+ "${{DICT_NAME}}": 1m
49+ ' > conf/config.yaml
50+
51+ DICT_NAME=env_dict make init
52+
53+ if ! grep " lua_shared_dict env_dict 1m;" conf/nginx.conf > /dev/null; then
54+ echo " failed: resolve env var used as config key"
55+ exit 1
56+ fi
57+
58+ if grep -F ' ${{DICT_NAME}}' conf/nginx.conf > /dev/null; then
59+ echo " failed: stale unresolved env var key should be removed"
60+ exit 1
61+ fi
62+
63+ echo " passed: resolve env var used as config key"
64+
65+ git checkout conf/config.yaml
66+
4267echo "
4368plugins:
4469 - ip-restriction
You can’t perform that action at this time.
0 commit comments