1
0
mirror of https://github.com/1Panel-dev/1Panel.git synced 2025-01-19 08:19:15 +08:00

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 { if err != nil {
return fmt.Errorf("incorrect snapshot name format of %s", snap) 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{ itemSnap := model.Snapshot{
Name: snap, Name: snap,
From: req.From, From: req.From,