From 2d3521a56cca299693bf8a2d7f76e113758aa68a Mon Sep 17 00:00:00 2001 From: Anshul Ahuja Date: Mon, 2 Sep 2024 09:18:44 +0000 Subject: [PATCH] fix Signed-off-by: Anshul Ahuja --- pkg/restore/restore.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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 }