Skip to content

Commit

Permalink
dev: restore cr state before reconcile
Browse files Browse the repository at this point in the history
  • Loading branch information
sunsingerus committed Dec 15, 2024
1 parent f00ab73 commit 93ef151
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions pkg/controller/chi/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,14 @@ func (w *worker) updateCHI(ctx context.Context, old, new *api.ClickHouseInstalla
return nil
}

if new != nil {
n, err := w.c.kube.CR().Get(ctx, new.GetNamespace(), new.GetName())
if err != nil {
return err
}
new = n.(*api.ClickHouseInstallation)
}

if w.deleteCHI(ctx, old, new) {
// CHI is being deleted
return nil
Expand Down

0 comments on commit 93ef151

Please sign in to comment.