From 8fc4a782d49eae9c82abc2544ee0ebbef0cff83f Mon Sep 17 00:00:00 2001 From: maralavi Date: Mon, 25 Jul 2022 15:33:00 -0700 Subject: [PATCH] fix failing tests --- addons/controllers/packageinstallstatus_controller.go | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/addons/controllers/packageinstallstatus_controller.go b/addons/controllers/packageinstallstatus_controller.go index 4efa297d8a..bdd90894f3 100644 --- a/addons/controllers/packageinstallstatus_controller.go +++ b/addons/controllers/packageinstallstatus_controller.go @@ -205,12 +205,13 @@ func (r *PackageInstallStatusReconciler) reconcile(clusterClient client.Client, var errorList []error + patchHelper, err := clusterapipatchutil.NewHelper(clusterBootstrap, r.Client) + if err != nil { + errorList = append(errorList, errors.Wrap(err, "error patching ClusterBootstrapStatus")) + retErr = kerrors.NewAggregate(errorList) + } + defer func() { - patchHelper, err := clusterapipatchutil.NewHelper(clusterBootstrap, r.Client) - if err != nil { - errorList = append(errorList, errors.Wrap(err, "error patching ClusterBootstrapStatus")) - retErr = kerrors.NewAggregate(errorList) - } if err := patchHelper.Patch(r.ctx, clusterBootstrap); err != nil { errorList = append(errorList, errors.Wrap(err, "error patching ClusterBootstrapStatus")) retErr = kerrors.NewAggregate(errorList)