diff --git a/pkg/cluster/api/binlog.go b/pkg/cluster/api/binlog.go index 3705b6c56a..40d64bbc80 100644 --- a/pkg/cluster/api/binlog.go +++ b/pkg/cluster/api/binlog.go @@ -56,12 +56,12 @@ func NewBinlogClient(pdEndpoint []string, tlsConfig *tls.Config) (*BinlogClient, } func (c *BinlogClient) getURL(addr string) string { - schema := "http" + scheme := "http" if c.tls != nil { - schema = "https" + scheme = "https" } - return fmt.Sprintf("%s://%s", schema, addr) + return fmt.Sprintf("%s://%s", scheme, addr) } func (c *BinlogClient) getOfflineURL(addr string, nodeID string) string { diff --git a/pkg/cluster/manager/display.go b/pkg/cluster/manager/display.go index 65e7b4c104..baabb8e185 100644 --- a/pkg/cluster/manager/display.go +++ b/pkg/cluster/manager/display.go @@ -109,11 +109,11 @@ func (m *Manager) Display(name string, opt operator.Options) error { var err error dashboardAddr, err = t.GetDashboardAddress(tlsCfg, masterActive...) if dashboardAddr != "" && err == nil { - schema := "http" + scheme := "http" if tlsCfg != nil { - schema = "https" + scheme = "https" } - fmt.Printf("Dashboard URL: %s\n", cyan.Sprintf("%s://%s/dashboard", schema, dashboardAddr)) + fmt.Printf("Dashboard URL: %s\n", cyan.Sprintf("%s://%s/dashboard", scheme, dashboardAddr)) } } diff --git a/pkg/cluster/spec/grafana.go b/pkg/cluster/spec/grafana.go index ac403bd472..a21b09257b 100644 --- a/pkg/cluster/spec/grafana.go +++ b/pkg/cluster/spec/grafana.go @@ -16,7 +16,6 @@ package spec import ( "crypto/tls" "fmt" - "path" "path/filepath" "reflect" "strings" @@ -220,10 +219,12 @@ func (i *GrafanaInstance) initDashboards(e executor.Executor, spec GrafanaSpec, for _, cmd := range []string{ `find %s -type f -exec sed -i "s/\${DS_.*-CLUSTER}/%s/g" {} \;`, `find %s -type f -exec sed -i "s/DS_.*-CLUSTER/%s/g" {} \;`, + `find %s -type f -exec sed -i "s/\${DS_LIGHTNING}/%s/g" {} \;`, + `find %s -type f -exec sed -i "s/DS_LIGHTNING/%s/g" {} \;`, `find %s -type f -exec sed -i "s/test-cluster/%s/g" {} \;`, `find %s -type f -exec sed -i "s/Test-Cluster/%s/g" {} \;`, } { - cmd := fmt.Sprintf(cmd, path.Join(paths.Deploy, "dashboards"), clusterName) + cmd := fmt.Sprintf(cmd, dashboardsDir, clusterName) _, stderr, err := e.Execute(cmd, false) if err != nil { return errors.Annotatef(err, "stderr: %s", string(stderr)) diff --git a/pkg/cluster/spec/validate.go b/pkg/cluster/spec/validate.go index e6ac3a346e..749ac96f4a 100644 --- a/pkg/cluster/spec/validate.go +++ b/pkg/cluster/spec/validate.go @@ -346,7 +346,7 @@ func (e *TiKVLabelError) Error() string { return str } -// TiKVLabelProvider provide store labels information +// TiKVLabelProvider provides the store labels information type TiKVLabelProvider interface { GetTiKVLabels() (map[string]map[string]string, error) }