Removing unneeded if

This commit is contained in:
juanjo 2024-03-28 12:10:17 +01:00
parent f43d792b73
commit 6bc9e97e25
1 changed files with 9 additions and 11 deletions

View File

@ -173,7 +173,6 @@ func syncPV(ctx context.Context, c client.Client, log logr.Logger, ns string, pv
} }
// If ReclaimPolicy is not "Delete", we proceed to clean up the ClaimRef. // If ReclaimPolicy is not "Delete", we proceed to clean up the ClaimRef.
if pv.Status.Phase == corev1.VolumeReleased {
pvCopy := pv.DeepCopy() pvCopy := pv.DeepCopy()
delete(pvCopy.Labels, labelKeyCleanup) delete(pvCopy.Labels, labelKeyCleanup)
pvCopy.Spec.ClaimRef = nil pvCopy.Spec.ClaimRef = nil
@ -183,7 +182,6 @@ func syncPV(ctx context.Context, c client.Client, log logr.Logger, ns string, pv
} }
log.Info("PV should be Available now") log.Info("PV should be Available now")
}
return nil, nil return nil, nil
} }