Skip to content

feat(ops): use lua libs to backup config file insteadof shell command#7048

Merged
spacewander merged 7 commits into
apache:masterfrom
kwanhur:cli-ops-bak
May 23, 2022
Merged

feat(ops): use lua libs to backup config file insteadof shell command#7048
spacewander merged 7 commits into
apache:masterfrom
kwanhur:cli-ops-bak

Conversation

@kwanhur

@kwanhur kwanhur commented May 14, 2022

Copy link
Copy Markdown
Contributor

Description

To avoid tool loss in some OS, use Lua library related filesystem, like exist rename and link etc.

  • backup and recover files with os.rename insteadof mv
  • remove files with os.remove insteadof rm
  • link file with lfs.link insteadof ln
  • exist file with penlight.exist insteadof io.open

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)

* backup and recover files with os.rename insteadof mv
* remove files with os.remove insteadof rm
* link file with lfs.link insteadof ln
* exist file with penlight.exist insteadof io.open

Signed-off-by: kwanhur <[email protected]>
@kwanhur
kwanhur marked this pull request as ready for review May 14, 2022 06:06
Comment thread apisix/cli/ops.lua
@spacewander

Copy link
Copy Markdown
Member

Let's merge master to make CI pass.

@kwanhur

kwanhur commented May 16, 2022

Copy link
Copy Markdown
Contributor Author

Done.

spacewander
spacewander previously approved these changes May 17, 2022
tzssangglass
tzssangglass previously approved these changes May 17, 2022
Comment thread apisix/cli/ops.lua Outdated
@kwanhur
kwanhur dismissed stale reviews from tzssangglass and spacewander via a9dcb73 May 18, 2022 03:30
Co-authored-by: Alex Zhang <[email protected]>
spacewander
spacewander previously approved these changes May 19, 2022
@spacewander

Copy link
Copy Markdown
Member

@kwanhur
Let's resolve the conflicts. Thanks!

@kwanhur

kwanhur commented May 20, 2022

Copy link
Copy Markdown
Contributor Author

Fixed.

@spacewander
spacewander merged commit 38b0938 into apache:master May 23, 2022
@kwanhur
kwanhur deleted the cli-ops-bak branch May 23, 2022 06:05
hongbinhsu pushed a commit to fitphp/apix that referenced this pull request May 24, 2022
* upsgrteam/master: (351 commits)
  fix(proxy-cache): bypass when method mismatch cache_method (apache#7111)
  chore(script): support to install dependencies under arm64 (apache#7091)
  chore(ci): use the latest build script for apisix-base (apache#7090)
  fix(batch-requests): ignore "unix:" in the configuration (apache#7106)
  fix: install dependencies issues (apache#7092)
  feat(ops): use lua libs to backup config file insteadof shell command (apache#7048)
  test: reduce CI failure caused by flaky tests (apache#7085)
  chore(ci): move set_dns.sh to ci dir (apache#7089)
  feat: release 2.14.0 (apache#7057)
  docs: update "Tracers" Plugins (apache#7086)
  docs: update "Traffic" Plugin docs 3 (apache#7064)
  docs: update "Serverless" Plugins (apache#7076)
  feat(ops): check process running with posix.signal insteadof lsof (apache#7006)
  docs: modify how-to-build filename (apache#7087)
  docs: fix link of hot-reload in docs (apache#7081)
  chore(ci): apt update before install (apache#7080)
  docs: add pubsub develop example for kafka (apache#7059)
  ci: enable rebase in some situation (apache#7074)
  fix: redirect http to https but port not change (apache#7065)
  ci: make it pass under OpenResty 1.21 (apache#7067)
  ...
spacewander pushed a commit that referenced this pull request Jun 30, 2022
Liu-Junlin pushed a commit to Liu-Junlin/apisix that referenced this pull request Nov 4, 2022
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.

4 participants