From d985291debede73b4fdd4aa58c725a5ffed6a58c Mon Sep 17 00:00:00 2001 From: SSmallMonster Date: Mon, 15 Jul 2024 20:08:23 +0800 Subject: [PATCH] fix(InstallCRDs): reverse CRD install status when necessary close #291(hwameistor-operator) Signed-off-by: SSmallMonster --- controllers/cluster_controller.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/controllers/cluster_controller.go b/controllers/cluster_controller.go index 69670471..1176311c 100644 --- a/controllers/cluster_controller.go +++ b/controllers/cluster_controller.go @@ -115,7 +115,7 @@ func (r *ClusterReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ct // status.installedCRDs true bool value will cause hwameistor crds not updated when upgrade, // so we turn status.installedCRDS to false bool value here once spec generation changed. // That will ensure hwameistor crds updating not missed when upgrading. - if r.ClusterSpecGeneration != newInstance.Generation { + if r.ClusterSpecGeneration != newInstance.Generation && newInstance.Status.InstalledCRDS{ log.Infof("cached cluster spec generation:%v, gotten cluster generation: %v", r.ClusterSpecGeneration, newInstance.Generation) log.Infof("going to set status.installedCRDS to false bool value") newInstance.Status.InstalledCRDS = false