From 69bc84cf0c1a7d15f061564da32242b89347ee16 Mon Sep 17 00:00:00 2001 From: Lyndon-Li Date: Thu, 3 Aug 2023 12:31:34 +0800 Subject: [PATCH] fix issue 6571 Signed-off-by: Lyndon-Li --- changelogs/unreleased/6594-Lyndon-Li | 1 + pkg/controller/restore_controller.go | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) create mode 100644 changelogs/unreleased/6594-Lyndon-Li diff --git a/changelogs/unreleased/6594-Lyndon-Li b/changelogs/unreleased/6594-Lyndon-Li new file mode 100644 index 000000000..67232c083 --- /dev/null +++ b/changelogs/unreleased/6594-Lyndon-Li @@ -0,0 +1 @@ +Fix issue #6571, fix the problem for restore item operation to set the errors correctly so that they can be recorded by Velero restore and then reflect the correct status for Velero restore. \ No newline at end of file diff --git a/pkg/controller/restore_controller.go b/pkg/controller/restore_controller.go index b118781eb..076baf85c 100644 --- a/pkg/controller/restore_controller.go +++ b/pkg/controller/restore_controller.go @@ -535,8 +535,8 @@ func (r *restoreReconciler) runValidatedRestore(restore *api.Restore, info backu // Completed yet. inProgressOperations, _, opsCompleted, opsFailed, errs := getRestoreItemOperationProgress(restoreReq.Restore, pluginManager, *restoreReq.GetItemOperationsList()) if len(errs) > 0 { - for err := range errs { - restoreLog.Error(err) + for _, err := range errs { + restoreErrors.Velero = append(restoreErrors.Velero, fmt.Sprintf("error from restore item operation: %v", err)) } }