apisix
apisix copied to clipboard
bug: config.yaml can only use those defined in config-default.yaml
Issue description
config.yaml is used to override those configurations in config-default.yaml.
The problem is that some configurations are too niche to be included in config-default.yaml. Such as proxy_protocol.
But if you override something not in config-default.yaml, you will get an error when you init apisix.
Environment
- apisix version (cmd:
apisix version): 2.0 - OS: Mac
Minimal test code / Steps to reproduce the issue
- Add proxy protocol in config.yaml
- Run make init
What's the actual result? (including assertion message & call stack if applicable)
You will get this error:
lua: ./bin/apisix:808: attempt to index a nil value (local 'base')
stack traceback:
./bin/apisix:808: in upvalue 'merge_conf'
./bin/apisix:805: in upvalue 'merge_conf'
./bin/apisix:805: in upvalue 'merge_conf'
./bin/apisix:849: in upvalue 'read_yaml_conf'
./bin/apisix:1015: in field '?'
./bin/apisix:1355: in main chunk
[C]: in ?
make: *** [init] Error 1
What's the expected result?
make init should be able to handle this case: when a config is not defined in config-default.yaml, but defined in config.yaml
Fixed by https://github.com/apache/apisix/pull/2476
@JanLi-air feel free to reopen this issue if you still have this problem