From f6010c7dcf235a661d82eb708a8ab70e7fa743b4 Mon Sep 17 00:00:00 2001 From: LINKIWI Date: Tue, 10 Aug 2021 19:43:15 -0700 Subject: [PATCH] Fix endpoint scheme detection for TLS origination to PD (#977) --- cmd/tidb-dashboard/main.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/cmd/tidb-dashboard/main.go b/cmd/tidb-dashboard/main.go index f0be488058..d0dce2d02b 100644 --- a/cmd/tidb-dashboard/main.go +++ b/cmd/tidb-dashboard/main.go @@ -98,9 +98,6 @@ func NewCLIConfig() *DashboardCLIConfig { } cfg.CoreConfig.NormalizePublicPathPrefix() - if err := cfg.CoreConfig.NormalizePDEndPoint(); err != nil { - log.Fatal("Invalid PD Endpoint", zap.Error(err)) - } // setup TLS config for TiDB components if len(*clusterCaPath) != 0 && len(*clusterCertPath) != 0 && len(*clusterKeyPath) != 0 { @@ -113,6 +110,10 @@ func NewCLIConfig() *DashboardCLIConfig { cfg.CoreConfig.TiDBTLSConfig = buildTLSConfig(tidbCaPath, tidbKeyPath, tidbCertPath) } + if err := cfg.CoreConfig.NormalizePDEndPoint(); err != nil { + log.Fatal("Invalid PD Endpoint", zap.Error(err)) + } + // keyvisual check startTime := cfg.KVFileStartTime endTime := cfg.KVFileEndTime