Skip to content

Commit

Permalink
dev: propagate recocnile error
Browse files Browse the repository at this point in the history
  • Loading branch information
sunsingerus committed Oct 10, 2024
1 parent ab1f5fb commit 397ba75
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 8 deletions.
14 changes: 10 additions & 4 deletions pkg/controller/chi/worker-chi-reconciler.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 10 additions & 4 deletions pkg/controller/chk/worker-chk-reconciler.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 397ba75

Please sign in to comment.