From f488d227167df542bf21ddc5efa143b60b1f21d7 Mon Sep 17 00:00:00 2001
From: Zhuo Qiu
Date: Mon, 5 Jun 2023 11:01:00 +0800
Subject: [PATCH] fix crash when reconcilePVC() failed
Signed-off-by: Zhuo Qiu
---
pkg/controller/chi/worker-reconciler.go | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/pkg/controller/chi/worker-reconciler.go b/pkg/controller/chi/worker-reconciler.go
index e08c0eaa2..58babc661 100644
--- a/pkg/controller/chi/worker-reconciler.go
+++ b/pkg/controller/chi/worker-reconciler.go
@@ -801,14 +801,14 @@ func (w *worker) reconcilePVCs(ctx context.Context, host *chiV1.ChiHost) error {
}
}
- pvc, err = w.reconcilePVC(ctx, pvc, host, volumeClaimTemplate)
+ newPvc, err := w.reconcilePVC(ctx, pvc, host, volumeClaimTemplate)
if err != nil {
w.a.M(host).F().Error("ERROR unable to reconcile PVC(%s/%s) err: %v", namespace, pvcName, err)
w.task.registryFailed.RegisterPVC(pvc.ObjectMeta)
return
}
- w.task.registryReconciled.RegisterPVC(pvc.ObjectMeta)
+ w.task.registryReconciled.RegisterPVC(newPvc.ObjectMeta)
})
return nil