Skip to content

Commit

Permalink
Clean PVC's DataSource and DataSourceRef by setting them to nil.
Browse files Browse the repository at this point in the history
Signed-off-by: Xun Jiang <[email protected]>
  • Loading branch information
Xun Jiang committed Apr 11, 2023
1 parent f4c92fa commit d680c7a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions internal/restore/pvc_action.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,8 @@ func (p *PVCRestoreItemAction) Execute(input *velero.RestoreItemActionExecuteInp
if boolptr.IsSetToFalse(input.Restore.Spec.RestorePVs) {
p.Log.Infof("Restore did not request for PVs to be restored from snapshot %s/%s.", input.Restore.Namespace, input.Restore.Name)
pvc.Spec.VolumeName = ""
pvc.Spec.DataSource = &corev1api.TypedLocalObjectReference{}
pvc.Spec.DataSourceRef = &corev1api.TypedLocalObjectReference{}
pvc.Spec.DataSource = nil
pvc.Spec.DataSourceRef = nil
} else {
_, snapClient, err := util.GetClients()
if err != nil {
Expand Down

0 comments on commit d680c7a

Please sign in to comment.