Commit d4de19a1 authored by yangk's avatar yangk
Browse files

Fix slice bounds out of range

parent 79fa5692
Showing with 5 additions and 3 deletions
+5 -3
......@@ -277,9 +277,11 @@ func (b *BackupAPPRestore) restoreVersionAndData(backup *dbmodel.AppBackup, appS
// before version 5.0.4, path name is pvc name, eg manual16-grcaa708-0
if len(newNameTmp) == 3 {
newNameTmp[1] = b.serviceChange[b.getOldServiceID(app.ServiceID)].ServiceAlias
oldVolumeID, _ := strconv.Atoi(newNameTmp[0][6:])
if oldVolumeID > 0 {
newNameTmp[0] = fmt.Sprintf("manual%d", b.volumeIDMap[uint(oldVolumeID)])
if len(newNameTmp[0]) > 6 {
oldVolumeID, _ := strconv.Atoi(newNameTmp[0][6:])
if oldVolumeID > 0 {
newNameTmp[0] = fmt.Sprintf("manual%d", b.volumeIDMap[uint(oldVolumeID)])
}
}
}
newName := strings.Join(newNameTmp, "-")
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment