File tree Expand file tree Collapse file tree 1 file changed +4
-8
lines changed
Expand file tree Collapse file tree 1 file changed +4
-8
lines changed Original file line number Diff line number Diff 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 ()
You can’t perform that action at this time.
0 commit comments