I don't want to set up different config-default.yaml for different environments
Issue description
config template is a very good idea. But I don't want set up config-default-dev.yaml for dev env when APISIX_PROFILE=dev. I want to use the same config-default.yaml for both development and production environments. But I can still use the config.yaml on production env, and the config-dev.yaml on development env.
Environment
- apisix version (cmd:
apisix version): 2.0 - OS: Ubuntu
@membphis
Should we use the same config-default.yaml for different profiles?
I has the second problem: when i custom config in the config.yaml. it can't merge. and has some errors. I found the problem code in the apisix script:
local function merge_conf(base, new_tab)
for key, val in pairs(new_tab) do
if type(val) == "table" then
if tab_is_array(val) then
base[key] = val
else
merge_conf(base[key], val)
end
else
base[key] = val
end
end
return base
end
can we add custom config support in the config.yaml?
@griffenliu Do you mean https://github.com/apache/apisix/pull/2476?
@spacewander yes, #2476 seems to solve my problem, thanks.
Its title should be "DISCUSS". I think the second question should be raised as another issue, but since it has been fixed, just ignore it :-D
@membphis Should we use the same
config-default.yamlfor different profiles?
for config-default.yaml, only one version. we use the same config-default.yaml for different profiles.
@griffenliu please feel free to reopen this issue if you still have a question for this issue.
@membphis Should we use the same
config-default.yamlfor different profiles?for
config-default.yaml, only one version. we use the sameconfig-default.yamlfor different profiles.
But when i use the apisix version 2.0 and profile is dev. when apisix start, it required config-default-dev.yaml.
local function read_yaml_conf()
local profile = require("apisix.core.profile")
profile.apisix_home = apisix_home .. "/"
local local_conf_path = profile:yaml_path("config-default")
But when i use the apisix version 2.0 and profile is dev. when apisix start, it required config-default-dev.yaml.
let us fix it, I think that is a bug.