From 2601135225f962637380ca297c912e3009ab0eab Mon Sep 17 00:00:00 2001 From: ssongliu <73214554+ssongliu@users.noreply.github.com> Date: Tue, 21 Mar 2023 18:46:31 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=A7=A3=E5=86=B3=E5=BF=AB=E7=85=A7?= =?UTF-8?q?=E5=90=8C=E6=AD=A5=E6=81=A2=E5=A4=8D=E5=A4=B1=E8=B4=A5=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98=20(#345)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fix: 解决快照同步恢复失败的问题 --- backend/app/service/snapshot.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/backend/app/service/snapshot.go b/backend/app/service/snapshot.go index 0654ebb9a..5adeac4d9 100644 --- a/backend/app/service/snapshot.go +++ b/backend/app/service/snapshot.go @@ -66,6 +66,9 @@ func (u *SnapshotService) SnapshotImport(req dto.SnapshotImport) error { if err != nil { return fmt.Errorf("incorrect snapshot name format of %s", snap) } + if strings.HasSuffix(snap, ".tar.gz") { + snap = strings.ReplaceAll(snap, ".tar.gz", "") + } itemSnap := model.Snapshot{ Name: snap, From: req.From,