diff --git a/controllers/dataprotection/utils.go b/controllers/dataprotection/utils.go index fb461a91ee9..5ffbb5fec91 100644 --- a/controllers/dataprotection/utils.go +++ b/controllers/dataprotection/utils.go @@ -200,7 +200,7 @@ func sendWarningEventForError(recorder record.EventRecorder, backup *dataprotect var configVolumeSnapshotError = []string{ "Failed to set default snapshot class with error", "Failed to get snapshot class with error", - "Failed to create snapshot content with error", + "Failed to create snapshot content with error cannot find CSI PersistentVolumeSource for volume", } func isVolumeSnapshotConfigError(snap *snapshotv1.VolumeSnapshot) bool { diff --git a/internal/controller/plan/restore.go b/internal/controller/plan/restore.go index 22933c0fdf5..8b3674593cc 100644 --- a/internal/controller/plan/restore.go +++ b/internal/controller/plan/restore.go @@ -607,7 +607,10 @@ func (p *RestoreManager) BuildDatafileRestoreJobByPVCS(synthesizedComponent *com volumes = append(volumes, synthesizedComponent.PodSpec.Volumes...) volumeMounts := make([]corev1.VolumeMount, 0) for _, volume := range volumes { - volumeMounts = append(volumeMounts, volumeMountMap[volume.Name]) + if vmount, ok := volumeMountMap[volume.Name]; ok { + volumeMounts = append(volumeMounts, vmount) + } + } jobName := p.GetDatafileRestoreJobName(pvcName) job, err := builder.BuildRestoreJob(p.Cluster, synthesizedComponent, jobName, backupTool.Spec.Image,