From 397ba75cb555e399a08a46848bd9a8a0da15dd2e Mon Sep 17 00:00:00 2001 From: Vladislav Klimenko Date: Thu, 10 Oct 2024 15:54:10 +0300 Subject: [PATCH] dev: propagate recocnile error --- pkg/controller/chi/worker-chi-reconciler.go | 14 ++++++++++---- pkg/controller/chk/worker-chk-reconciler.go | 14 ++++++++++---- 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/pkg/controller/chi/worker-chi-reconciler.go b/pkg/controller/chi/worker-chi-reconciler.go index bbd965e13..bb9850518 100644 --- a/pkg/controller/chi/worker-chi-reconciler.go +++ b/pkg/controller/chi/worker-chi-reconciler.go @@ -576,18 +576,24 @@ func (w *worker) reconcileHost(ctx context.Context, host *api.Host) error { startTime := time.Now() if host.IsFirst() { - w.reconcileCRServicePreliminary(ctx, host.GetCR()) + _ = w.reconcileCRServicePreliminary(ctx, host.GetCR()) defer w.reconcileCRServiceFinal(ctx, host.GetCR()) } // Create artifacts w.stsReconciler.PrepareHostStatefulSetWithStatus(ctx, host, false) - w.reconcileHostPrepare(ctx, host) - w.reconcileHostMain(ctx, host) + if err := w.reconcileHostPrepare(ctx, host); err != nil { + return err + } + if err := w.reconcileHostMain(ctx, host); err != nil { + return err + } // Host is now added and functional host.GetReconcileAttributes().UnsetAdd() - w.reconcileHostBootstrap(ctx, host) + if err := w.reconcileHostBootstrap(ctx, host); err != nil { + return err + } now := time.Now() hostsCompleted := 0 diff --git a/pkg/controller/chk/worker-chk-reconciler.go b/pkg/controller/chk/worker-chk-reconciler.go index 27203ee83..eea2aecf7 100644 --- a/pkg/controller/chk/worker-chk-reconciler.go +++ b/pkg/controller/chk/worker-chk-reconciler.go @@ -511,18 +511,24 @@ func (w *worker) reconcileHost(ctx context.Context, host *api.Host) error { defer w.a.V(2).M(host).E().P() if host.IsFirst() { - w.reconcileCRServicePreliminary(ctx, host.GetCR()) + _ = w.reconcileCRServicePreliminary(ctx, host.GetCR()) defer w.reconcileCRServiceFinal(ctx, host.GetCR()) } // Create artifacts w.stsReconciler.PrepareHostStatefulSetWithStatus(ctx, host, false) - w.reconcileHostPrepare(ctx, host) - w.reconcileHostMain(ctx, host) + if err := w.reconcileHostPrepare(ctx, host); err != nil { + return err + } + if err := w.reconcileHostMain(ctx, host); err != nil { + return err + } // Host is now added and functional host.GetReconcileAttributes().UnsetAdd() - w.reconcileHostBootstrap(ctx, host) + if err := w.reconcileHostBootstrap(ctx, host); err != nil { + return err + } now := time.Now() hostsCompleted := 0