aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorsanthoshkumar <[email protected]>2024-11-18 20:10:51 +0530
committerGitHub <[email protected]>2024-11-18 14:40:51 +0000
commitb3ce260389a88a35c9b0e0a19a93abfe92fb6e9f (patch)
treeb63acb59be8601c7f4155078f0ca2a016a52d505
parent6028ff27fa8eb65ffc0770386cbf6a9ac9f50a48 (diff)
downloadcaddy-b3ce260389a88a35c9b0e0a19a93abfe92fb6e9f.tar.gz
caddy-b3ce260389a88a35c9b0e0a19a93abfe92fb6e9f.zip
cmd: ignore missing keys during storage export (#6697)
-rw-r--r--cmd/storagefuncs.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/cmd/storagefuncs.go b/cmd/storagefuncs.go
index 60e25485d..3c4219719 100644
--- a/cmd/storagefuncs.go
+++ b/cmd/storagefuncs.go
@@ -21,6 +21,7 @@ import (
"errors"
"fmt"
"io"
+ "io/fs"
"os"
"github.com/caddyserver/certmagic"
@@ -190,12 +191,20 @@ func cmdExportStorage(fl Flags) (int, error) {
for _, k := range keys {
info, err := stor.Stat(ctx, k)
if err != nil {
+ if errors.Is(err, fs.ErrNotExist) {
+ caddy.Log().Warn(fmt.Sprintf("key: %s removed while export is in-progress", k))
+ continue
+ }
return caddy.ExitCodeFailedQuit, err
}
if info.IsTerminal {
v, err := stor.Load(ctx, k)
if err != nil {
+ if errors.Is(err, fs.ErrNotExist) {
+ caddy.Log().Warn(fmt.Sprintf("key: %s removed while export is in-progress", k))
+ continue
+ }
return caddy.ExitCodeFailedQuit, err
}