Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(backup, cstor): fetching correct snap name in case of base backup failure #1622

Merged
merged 2 commits into from
Mar 4, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cmd/cstor-pool-mgmt/volumereplica/volumereplica.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
6 changes: 3 additions & 3 deletions cmd/maya-apiserver/app/server/backup_endpoint_v1alpha1.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
}

Expand All @@ -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
}

Expand Down