Skip to content

Commit

Permalink
fix(vd): remove pv
Browse files Browse the repository at this point in the history
Signed-off-by: yaroslavborbat <yaroslav.752@gmail.com>
Signed-off-by: Isteb4k <dmitry.rakitin@flant.com>
  • Loading branch information
Isteb4k committed Aug 29, 2024
1 parent d514509 commit 21a4f77
Showing 1 changed file with 3 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,25 +57,21 @@ func (ds ObjectRefVirtualDiskSnapshot) Sync(ctx context.Context, vd *virtv2.Virt
if err != nil {
return false, err
}
pv, err := ds.diskService.GetPersistentVolume(ctx, pvc)
if err != nil {
return false, err
}

switch {
case isDiskProvisioningFinished(*condition):
log.Info("Disk provisioning finished: clean up")

setPhaseConditionForFinishedDisk(pv, pvc, condition, &vd.Status.Phase, supgen)
setPhaseConditionForFinishedDisk(pvc, condition, &vd.Status.Phase, supgen)

// Protect Ready Disk and underlying PVC and PV.
err = ds.diskService.Protect(ctx, vd, nil, pvc, pv)
err = ds.diskService.Protect(ctx, vd, nil, pvc)
if err != nil {
return false, err
}

return false, nil
case common.AnyTerminating(pvc, pv):
case common.IsTerminating(pvc):
log.Info("Waiting for supplements to be terminated")
return true, nil
case pvc == nil:
Expand Down

0 comments on commit 21a4f77

Please sign in to comment.