Check the failed phases either when uploading the snapshot in E2E testing (#4162)

When the snapshot uploading is failed, it should not be treat as completed and continue.
This commit covers both the phases of in progress and failed when uploading snapshot with vSphere plugin

Signed-off-by: Wenkai Yin(尹文开) <yinw@vmware.com>
This commit is contained in:
Wenkai Yin(尹文开)
2021-11-10 09:13:30 +08:00
committed by GitHub
parent e4019f26c1
commit 27f3a6d8d8

View File

@@ -449,11 +449,12 @@ func waitForVSphereUploadCompletion(ctx context.Context, timeout time.Duration,
// Canceled - the operation was canceled, the snapshot ID is not valid
if len(comps) == 2 {
phase := comps[1]
if phase == "New" ||
phase == "InProgress" ||
phase == "Snapshotted" ||
phase == "Uploading" {
switch phase {
case "Uploaded":
case "New", "InProgress", "Snapshotted", "Uploading":
complete = false
default:
return false, fmt.Errorf("unexpected snapshot phase: %s", phase)
}
}
}