core: reload go routine after CR is edited

Previously, the struct maintaining the list of cluster was still
initialized with a cluster item. Then the monitoring check will see that
the cluster is part of the struct already and thus won't run the
monitoring go routine again.
Now each time we cancel the context, we also remove the cluster item
from the map so that when the controller runs again, the monitoring
struct is re-populated and the go routine runs and statuses are updated.

Closes: https://github.com/rook/rook/issues/9911
Signed-off-by: Sébastien Han <seb@redhat.com>
(cherry picked from commit 05506e7a68)
This commit is contained in:
Sébastien Han committed 2022-03-31 16:23:38 +02:00
1 parent bb7b6b918b
commit fc9278c040
10 files changed
+77 -34

No files matched your search

@@ -42,6 +42,12 @@ type OperatorConfig struct {
Parameters map[string]string
}
// ClusterHealth is passed to the various monitoring go routines to stop them when the context is cancelled
type ClusterHealth struct {
InternalCtx context.Context
InternalCancel context.CancelFunc
}
const (
// OperatorSettingConfigMapName refers to ConfigMap that configures rook ceph operator
OperatorSettingConfigMapName string = "rook-ceph-operator-config"