Skip to content

Commit 3c5be03

Browse files
authored
enhance backup/restore error by adding velero logs (#469)
1 parent 7e3a025 commit 3c5be03

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

tests/e2e/backup.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,5 +58,5 @@ func isBackupCompletedSuccessfully(ocClient client.Client, veleroNamespace, name
5858
if backup.Status.Phase == velero.BackupPhaseCompleted {
5959
return true, nil
6060
}
61-
return false, fmt.Errorf("backup phase is: %s; expected: %s\nvalidation errors: %v", backup.Status.Phase, velero.BackupPhaseCompleted, backup.Status.ValidationErrors)
61+
return false, fmt.Errorf("backup phase is: %s; expected: %s\nvalidation errors: %v\nvelero failure logs: %v", backup.Status.Phase, velero.BackupPhaseCompleted, backup.Status.ValidationErrors, getVeleroContainerFailureLogs(veleroNamespace))
6262
}

tests/e2e/restore.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,5 +57,5 @@ func isRestoreCompletedSuccessfully(ocClient client.Client, veleroNamespace, nam
5757
if restore.Status.Phase == velero.RestorePhaseCompleted {
5858
return true, nil
5959
}
60-
return false, fmt.Errorf("restore phase is: %s; expected: %s\nfailure reason: %s\nvalidation errors: %v", restore.Status.Phase, velero.RestorePhaseCompleted, restore.Status.FailureReason, restore.Status.ValidationErrors)
60+
return false, fmt.Errorf("restore phase is: %s; expected: %s\nfailure reason: %s\nvalidation errors: %v\nvelero failure logs: %v", restore.Status.Phase, velero.RestorePhaseCompleted, restore.Status.FailureReason, restore.Status.ValidationErrors, getVeleroContainerFailureLogs(veleroNamespace))
6161
}

0 commit comments

Comments
 (0)