mirror of
https://github.com/vmware-tanzu/velero.git
synced 2026-01-06 21:36:30 +00:00
Merge pull request #7096 from Lyndon-Li/issue-fix-7094
Issue 7094: fallback to full backup if previous snapshot is not found
This commit is contained in:
1
changelogs/unreleased/7096-Lyndon-Li
Normal file
1
changelogs/unreleased/7096-Lyndon-Li
Normal file
@@ -0,0 +1 @@
|
||||
Fix issue #7094, fallback to full backup if previous snapshot is not found
|
||||
@@ -236,10 +236,10 @@ func SnapshotSource(
|
||||
|
||||
mani, err := loadSnapshotFunc(ctx, rep, manifest.ID(parentSnapshot))
|
||||
if err != nil {
|
||||
return "", 0, errors.Wrapf(err, "Failed to load previous snapshot %v from kopia", parentSnapshot)
|
||||
log.WithError(err).Warnf("Failed to load previous snapshot %v from kopia, fallback to full backup", parentSnapshot)
|
||||
} else {
|
||||
previous = append(previous, mani)
|
||||
}
|
||||
|
||||
previous = append(previous, mani)
|
||||
} else {
|
||||
log.Infof("Searching for parent snapshot")
|
||||
|
||||
|
||||
@@ -112,7 +112,7 @@ func TestSnapshotSource(t *testing.T) {
|
||||
notError: true,
|
||||
},
|
||||
{
|
||||
name: "failed to load snapshot",
|
||||
name: "failed to load snapshot, should fallback to full backup and not error",
|
||||
args: []mockArgs{
|
||||
{methodName: "LoadSnapshot", returns: []interface{}{manifest, errors.New("failed to load snapshot")}},
|
||||
{methodName: "SaveSnapshot", returns: []interface{}{manifest.ID, nil}},
|
||||
@@ -122,7 +122,7 @@ func TestSnapshotSource(t *testing.T) {
|
||||
{methodName: "Upload", returns: []interface{}{manifest, nil}},
|
||||
{methodName: "Flush", returns: []interface{}{nil}},
|
||||
},
|
||||
notError: false,
|
||||
notError: true,
|
||||
},
|
||||
{
|
||||
name: "failed to save snapshot",
|
||||
|
||||
Reference in New Issue
Block a user