Description
Since PR #9846, the cleanup(env) function has been refactored to do two things:
- Set profile.apisix_home = env.apisix_home if env.apisix_home is not nil.
- Remove the customized_yaml_index env variable.
See: ops.lua#L768-L798
This refactor is fine, but I noticed that the start command still performs step (1) again, immediately after calling cleanup(env):
local function start(env, ...)
cleanup(env)
if env.apisix_home then
profile.apisix_home = env.apisix_home
end
...
end
Since cleanup(env) already sets profile.apisix_home, the extra assignment in start looks redundant and I did not find any statement in the PR explaining why this duplicate is needed.
Proposal:
Remove the duplicate assignment in start to simplify the code.
Description
Since PR #9846, the cleanup(env) function has been refactored to do two things:
See: ops.lua#L768-L798
This refactor is fine, but I noticed that the start command still performs step (1) again, immediately after calling cleanup(env):
Since cleanup(env) already sets profile.apisix_home, the extra assignment in start looks redundant and I did not find any statement in the PR explaining why this duplicate is needed.
Proposal:
Remove the duplicate assignment in start to simplify the code.