Skip to content

Commit 958312f

Browse files
committed
fix: only parse and validate apisix.yaml in cli when startup
Signed-off-by: Nic <[email protected]>
1 parent d16fec5 commit 958312f

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

apisix/cli/file.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ local function merge_conf(base, new_tab, ppath)
226226
end
227227

228228

229-
function _M.read_yaml_conf(apisix_home)
229+
function _M.read_yaml_conf(apisix_home, validate_config_provider)
230230
if apisix_home then
231231
profile.apisix_home = apisix_home .. "/"
232232
end
@@ -293,7 +293,7 @@ function _M.read_yaml_conf(apisix_home)
293293
end
294294
end
295295

296-
if default_conf.deployment.config_provider == "yaml" then
296+
if default_conf.deployment.config_provider == "yaml" and validate_config_provider then
297297
local apisix_conf_path = profile:yaml_path("apisix")
298298
local apisix_conf_yaml, _ = util.read_file(apisix_conf_path)
299299
if apisix_conf_yaml then

apisix/cli/ops.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ local function init(env)
171171
end
172172

173173
-- read_yaml_conf
174-
local yaml_conf, err = file.read_yaml_conf(env.apisix_home)
174+
local yaml_conf, err = file.read_yaml_conf(env.apisix_home, true)
175175
if not yaml_conf then
176176
util.die("failed to read local yaml config of apisix: ", err, "\n")
177177
end

0 commit comments

Comments
 (0)