Skip to content

Commit 615c7d7

Browse files
chore: don't skip if ns is same as the intermediate restore still happens in velero ns
Signed-off-by: Abhinandan Purkait <[email protected]>
1 parent 34b3428 commit 615c7d7

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

pkg/mayastor/plugin/restoreplugin.go

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,16 +41,12 @@ func (p *RestorePlugin) Execute(input *velero.RestoreItemActionExecuteInput) (*v
4141
return nil, fmt.Errorf("failed to access metadata for backed up PVC: %w", err)
4242
}
4343

44-
originalNS := metadata.GetNamespace()
45-
restoreNS, ok := input.Restore.Spec.NamespaceMapping[originalNS]
44+
backupNS := metadata.GetNamespace()
45+
restoreNS, ok := input.Restore.Spec.NamespaceMapping[backupNS]
4646

47+
// If no namespace mapping is provided restore would happen in the backup namespace
4748
if !ok || restoreNS == "" {
48-
restoreNS = originalNS
49-
}
50-
51-
if restoreNS == originalNS {
52-
p.log.Infof("Skipping PVC %s: namespace unchanged (%s)", metadata.GetName(), originalNS)
53-
return velero.NewRestoreItemActionExecuteOutput(item), nil
49+
restoreNS = backupNS
5450
}
5551

5652
annotations := metadata.GetAnnotations()

0 commit comments

Comments
 (0)