From a33b42fb4240e29fc088bd739d55d88282814393 Mon Sep 17 00:00:00 2001 From: nexustar Date: Wed, 26 Jan 2022 19:27:03 +0800 Subject: [PATCH] cluster: fix display wrong status due to closure --- pkg/cluster/spec/alertmanager.go | 1 + pkg/cluster/spec/grafana.go | 1 + pkg/cluster/spec/monitoring.go | 1 + pkg/cluster/spec/tispark.go | 1 + 4 files changed, 4 insertions(+) diff --git a/pkg/cluster/spec/alertmanager.go b/pkg/cluster/spec/alertmanager.go index 722d91952d..a220715494 100644 --- a/pkg/cluster/spec/alertmanager.go +++ b/pkg/cluster/spec/alertmanager.go @@ -91,6 +91,7 @@ func (c *AlertManagerComponent) Instances() []Instance { ins := make([]Instance, 0, len(alertmanagers)) for _, s := range alertmanagers { + s := s ins = append(ins, &AlertManagerInstance{ BaseInstance: BaseInstance{ InstanceSpec: s, diff --git a/pkg/cluster/spec/grafana.go b/pkg/cluster/spec/grafana.go index 6158dd0eb6..53a9dfe8e2 100644 --- a/pkg/cluster/spec/grafana.go +++ b/pkg/cluster/spec/grafana.go @@ -99,6 +99,7 @@ func (c *GrafanaComponent) Instances() []Instance { ins := make([]Instance, 0, len(servers)) for _, s := range servers { + s := s ins = append(ins, &GrafanaInstance{ BaseInstance: BaseInstance{ InstanceSpec: s, diff --git a/pkg/cluster/spec/monitoring.go b/pkg/cluster/spec/monitoring.go index da01b25c44..9f0de67fcc 100644 --- a/pkg/cluster/spec/monitoring.go +++ b/pkg/cluster/spec/monitoring.go @@ -112,6 +112,7 @@ func (c *MonitorComponent) Instances() []Instance { ins := make([]Instance, 0, len(servers)) for _, s := range servers { + s := s mi := &MonitorInstance{BaseInstance{ InstanceSpec: s, Name: c.Name(), diff --git a/pkg/cluster/spec/tispark.go b/pkg/cluster/spec/tispark.go index eb16fa550d..bc9199d77d 100644 --- a/pkg/cluster/spec/tispark.go +++ b/pkg/cluster/spec/tispark.go @@ -135,6 +135,7 @@ func (c *TiSparkMasterComponent) Role() string { func (c *TiSparkMasterComponent) Instances() []Instance { ins := make([]Instance, 0, len(c.Topology.TiSparkMasters)) for _, s := range c.Topology.TiSparkMasters { + s := s ins = append(ins, &TiSparkMasterInstance{ BaseInstance: BaseInstance{ InstanceSpec: s,