From a835cc730c9bedd7f16a9a8b5c2c38464b71e189 Mon Sep 17 00:00:00 2001 From: Utku Ozdemir Date: Mon, 18 Mar 2024 23:51:56 +0100 Subject: [PATCH] fix: fix error handling in image pre pull task If no error occurs during pulling an image, do not gather it in multi-error, causing the task to be wrongly marked as failed. Signed-off-by: Utku Ozdemir --- .../omni/controllers/omni/internal/task/image/pulltask.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/internal/backend/runtime/omni/controllers/omni/internal/task/image/pulltask.go b/internal/backend/runtime/omni/controllers/omni/internal/task/image/pulltask.go index 94c13d4f..d666ac56 100644 --- a/internal/backend/runtime/omni/controllers/omni/internal/task/image/pulltask.go +++ b/internal/backend/runtime/omni/controllers/omni/internal/task/image/pulltask.go @@ -98,8 +98,9 @@ func (p PullTaskSpec) RunTask(ctx context.Context, _ *zap.Logger, pullStatusCh P if nodeImageInfoMap.shouldPull(imageList.Node, img) { currentError = p.pullImage(ctx, clusterID, imageList.Node, img) - - errs = multierror.Append(errs, currentError) + if currentError != nil { + errs = multierror.Append(errs, currentError) + } skipFinalEvent = true // we are already sending an event, so no need to send one at the end