fix: 解决快照同步恢复失败的问题 (#345)

fix: 解决快照同步恢复失败的问题
This commit is contained in:
ssongliu 2023-03-21 18:46:31 +08:00 committed by GitHub
parent c556affc91
commit 2601135225
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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,