Skip to content

Commit

Permalink
fix TLS
Browse files Browse the repository at this point in the history
  • Loading branch information
nexustar committed Sep 22, 2022
1 parent 30fe1ef commit 8aa2e53
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
2 changes: 1 addition & 1 deletion embed/templates/scripts/run_tidb-dashboard.sh.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ exec bin/tidb-dashboard \
{{- if .TLSEnabled}}
--tidb-ca tls/ca.crt \
--tidb-cert tls/tidb-dashboard.crt \
--tidb-key tls/tidb-dasboard.pem \
--tidb-key tls/tidb-dashboard.pem \
{{- end}}
1>> "{{.LogDir}}/tidb_dashboard.log" \
2>> "{{.LogDir}}/tidb_dashboard_stderr.log"
7 changes: 1 addition & 6 deletions pkg/cluster/spec/dashboard.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ func (i *DashboardInstance) InitConfig(
Port: spec.Port,
NumaNode: spec.NumaNode,
Endpoints: topo.Endpoints(deployUser),
TLSEnabled: enableTLS,
}

fp := filepath.Join(paths.Cache, fmt.Sprintf("run_tidb-dashboard_%s_%d.sh", i.GetHost(), i.GetPort()))
Expand All @@ -190,12 +191,6 @@ func (i *DashboardInstance) InitConfig(

globalConfig := topo.ServerConfigs.Dashboard

// set TLS configs
spec.Config, err = i.setTLSConfig(ctx, enableTLS, spec.Config, paths)
if err != nil {
return err
}

if err := i.MergeServerConfig(ctx, e, globalConfig, spec.Config, paths); err != nil {
return err
}
Expand Down
2 changes: 2 additions & 0 deletions pkg/cluster/spec/validate.go
Original file line number Diff line number Diff line change
Expand Up @@ -937,6 +937,8 @@ func (s *Specification) validateTLSEnabled() error {
ComponentPump,
ComponentDrainer,
ComponentCDC,
ComponentTiKVCDC,
ComponentDashboard,
ComponentPrometheus,
ComponentAlertmanager,
ComponentGrafana:
Expand Down

0 comments on commit 8aa2e53

Please sign in to comment.