Skip to content

Commit

Permalink
fix: snapshot failed (#4173)
Browse files Browse the repository at this point in the history
  • Loading branch information
dengshaojiang committed Jul 7, 2023
1 parent 3655d26 commit e75dd4b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion controllers/dataprotection/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
5 changes: 4 additions & 1 deletion internal/controller/plan/restore.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit e75dd4b

Please sign in to comment.