diff --git a/pkg/restore/restore.go b/pkg/restore/restore.go index b78eb307e..471f38119 100644 --- a/pkg/restore/restore.go +++ b/pkg/restore/restore.go @@ -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 }