Skip to content

Possible redundant assignment of profile.apisix_home in start command #12528

Description

@flearc

Description

Since PR #9846, the cleanup(env) function has been refactored to do two things:

  1. Set profile.apisix_home = env.apisix_home if env.apisix_home is not nil.
  2. 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.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Status
✅ Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions