Signed-off-by: Anshul Ahuja <anshul.ahu@gmail.com>
This commit is contained in:
Anshul Ahuja
2024-09-02 09:18:44 +00:00
parent 434bd2f3ae
commit 2d3521a56c

View File

@@ -1950,10 +1950,14 @@ func hasCSIVolumeSnapshot(ctx *restoreContext, unstructuredPV *unstructured.Unst
ctx.log.WithError(err).Warnf("Unable to convert PV from unstructured to structured")
return false
}
// ignoring static PV cases where there is no claimRef
if pv.Spec.ClaimRef == nil {
return false
}
for _, vs := range ctx.csiVolumeSnapshots {
// In some error cases, the VSs' source PVC could be nil or PVs ClaimRef could be nil. Skip them.
if vs.Spec.Source.PersistentVolumeClaimName == nil || pv.Spec.ClaimRef == nil {
// In some error cases, the VSs' source PVC could be nil. Skip them.
if vs.Spec.Source.PersistentVolumeClaimName == nil {
continue
}