Skip to content

Commit

Permalink
Merge pull request #160 from blackpiglet/modify_DataSource
Browse files Browse the repository at this point in the history
Clean PVC's DataSource and DataSourceRef by setting them to nil.
  • Loading branch information
Lyndon-Li authored Apr 12, 2023
2 parents 591b59e + d680c7a commit 0f44f66
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 0f44f66

Please sign in to comment.