From 3c21a6b2d0779c80fc43767cdc3dd15cd7ae07e2 Mon Sep 17 00:00:00 2001 From: Mayank <33252549+mynktl@users.noreply.github.com> Date: Wed, 4 Mar 2020 09:32:27 +0530 Subject: [PATCH] fix(backup, cstor): fetching correct snap name in case of base backup failure (#1622) Signed-off-by: mayank --- cmd/cstor-pool-mgmt/volumereplica/volumereplica.go | 2 +- cmd/maya-apiserver/app/server/backup_endpoint_v1alpha1.go | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cmd/cstor-pool-mgmt/volumereplica/volumereplica.go b/cmd/cstor-pool-mgmt/volumereplica/volumereplica.go index d2fc72b439..f0ab97a50a 100644 --- a/cmd/cstor-pool-mgmt/volumereplica/volumereplica.go +++ b/cmd/cstor-pool-mgmt/volumereplica/volumereplica.go @@ -396,7 +396,7 @@ func CreateVolumeRestore(rst *apis.CStorRestore) error { "rname", rst.Spec.VolumeName, ) } else { - alertlog.Logger.Errorw("", + alertlog.Logger.Infow("", "eventcode", "cstor.volume.restore.success", "msg", "Successfully restored CStor volume", "rname", rst.Spec.VolumeName, diff --git a/cmd/maya-apiserver/app/server/backup_endpoint_v1alpha1.go b/cmd/maya-apiserver/app/server/backup_endpoint_v1alpha1.go index 5e73805802..6d28054b93 100644 --- a/cmd/maya-apiserver/app/server/backup_endpoint_v1alpha1.go +++ b/cmd/maya-apiserver/app/server/backup_endpoint_v1alpha1.go @@ -217,9 +217,8 @@ func getLastBackupSnap(openebsClient *versioned.Clientset, bkp *v1alpha1.CStorBa Labels: bkp.Labels, }, Spec: v1alpha1.CStorBackupSpec{ - BackupName: bkp.Spec.BackupName, - VolumeName: bkp.Spec.VolumeName, - PrevSnapName: bkp.Spec.SnapName, + BackupName: bkp.Spec.BackupName, + VolumeName: bkp.Spec.VolumeName, }, } @@ -231,6 +230,7 @@ func getLastBackupSnap(openebsClient *versioned.Clientset, bkp *v1alpha1.CStorBa klog.Infof("LastBackup resource created for backup:%s volume:%s", bk.Spec.BackupName, bk.Spec.VolumeName) return "", nil } + return b.Spec.PrevSnapName, nil }