Merge pull request #6369 from raghavendra-talur/rtalur-master-fix-crash

ceph: prevent closing of channel more than once
This commit is contained in:
Travis Nielsen authored and GitHub committed 2020-10-05 13:04:12 -06:00
commit 95358bc659
1 file changed
+3 -6
+3 -6
View File
@@ -369,13 +369,10 @@ func (c *ClusterController) requestClusterDelete(cluster *cephv1.CephCluster) (r
}
// close the goroutines watching the health of the cluster (mons, osds, ceph status)
var isDisabled bool
for _, daemon := range monitorDaemonList {
isDisabled = isMonitoringDisabled(daemon, cluster.Spec)
if _, ok := cluster.monitoringChannels[daemon]; ok {
if !isDisabled {
close(cluster.monitoringChannels[daemon].stopChan)
}
if monitoring, ok := cluster.monitoringChannels[daemon]; ok && monitoring.monitoringRunning {
close(cluster.monitoringChannels[daemon].stopChan)
cluster.monitoringChannels[daemon].monitoringRunning = false
}
}
}