Skip to content

refactor: access customized config directly#9846

Merged
juststillthinking merged 6 commits into
apache:masterfrom
jiangfucheng:custom_config
Jul 19, 2023
Merged

refactor: access customized config directly#9846
juststillthinking merged 6 commits into
apache:masterfrom
jiangfucheng:custom_config

Conversation

@jiangfucheng

@jiangfucheng jiangfucheng commented Jul 16, 2023

Copy link
Copy Markdown
Member

Description

Fixes #9171

Discussion in #9521 (comment)

Checklist

  • I have explained the need for this PR and the problem it solves
  • I have explained the changes or the new features added to this PR
  • I have added tests corresponding to this change
  • I have updated the documentation to reflect this change
  • I have verified that this change is backward compatible (If not, please discuss on the APISIX mailing list first)

@jiangfucheng

Copy link
Copy Markdown
Member Author

More test cases will be added.

@juststillthinking

Copy link
Copy Markdown
Contributor

@Revolyssup Please help to check this, to see if it works

Comment thread apisix/cli/file.lua Outdated
Comment thread apisix/cli/ops.lua Outdated
if not ok then
util.die("failed to backup config, error: ", err)
if not util.file_exists(customized_config_path) then
util.die("customized config file not exists, path: " .. customized_config_path)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jiangfucheng Just a note that in my PR here[1], I have moved out all util.Die outside the start function by returning errors.

  1. fix: cleanup stale custom configs with apisix start #9701

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this PR, we don't need to check the result of init() method or other failures in apisix start, we just remove the.config_path file before start is enough.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Revolyssup

Revolyssup commented Jul 17, 2023

Copy link
Copy Markdown
Contributor

@Revolyssup Please help to check this, to see if it works

I can confirm that this issue- #9171 as well as this- #9700 doesn't come up on this PR.

Comment thread apisix/cli/ops.lua Outdated
Comment thread apisix/cli/ops.lua Outdated
Comment thread apisix/core/profile.lua Outdated
Comment thread apisix/core/profile.lua Outdated
Comment thread t/cli/test_cmd.sh Outdated
Comment thread t/cli/test_cmd.sh Outdated
Comment thread t/cli/test_cmd.sh
@juststillthinking

Copy link
Copy Markdown
Contributor

Please fix the code lint

@juststillthinking

Copy link
Copy Markdown
Contributor

Could you add a test case to cover #9171?

@jiangfucheng

Copy link
Copy Markdown
Member Author

Could you add a test case to cover #9171?

Added.

@jiangfucheng

Copy link
Copy Markdown
Member Author

@monkeyDluffy6017 Please take a look again, thanks.

@juststillthinking

Copy link
Copy Markdown
Contributor

Please fix the code lint

@juststillthinking juststillthinking added the wait for update wait for the author's response in this issue/PR label Jul 18, 2023
@juststillthinking juststillthinking added approved and removed wait for update wait for the author's response in this issue/PR labels Jul 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: apisix start -c report failed to link customized config, error: File exists error

4 participants