From f28651e9a86db1099a5ad45444b0e623ebacbeed Mon Sep 17 00:00:00 2001 From: kkothule Date: Mon, 6 Nov 2023 15:57:37 +0530 Subject: [PATCH] Fix nil pointer in volumesnapshotcontent --- internal/backup/volumesnapshotcontent_action.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/internal/backup/volumesnapshotcontent_action.go b/internal/backup/volumesnapshotcontent_action.go index 61cd9d38..941b3486 100644 --- a/internal/backup/volumesnapshotcontent_action.go +++ b/internal/backup/volumesnapshotcontent_action.go @@ -80,7 +80,9 @@ func (p *VolumeSnapshotContentBackupItemAction) Execute(item runtime.Unstructure if vsc.Annotations == nil { vsc.Annotations = make(map[string]string) } - vals["cc-pvc-name"] = *vs.Spec.Source.PersistentVolumeClaimName + if vs.Spec.Source.PersistentVolumeClaimName != nil { + vals["cc-pvc-name"] = *vs.Spec.Source.PersistentVolumeClaimName + } vals["cc-pvc-namespace"] = vs.GetNamespace() util.AddAnnotations(&snapCont.ObjectMeta, vals) util.AddAnnotations(&vsc.ObjectMeta, vals)