From 9ff0f19daaa35ff7e8e56a536b06c6598db9519e Mon Sep 17 00:00:00 2001 From: Allen Zhong Date: Tue, 10 Aug 2021 12:16:41 +0800 Subject: [PATCH] cluster: skip updating topology when reload with --skip-restart --- pkg/cluster/manager/reload.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pkg/cluster/manager/reload.go b/pkg/cluster/manager/reload.go index ba92170664..25ef1e65cf 100644 --- a/pkg/cluster/manager/reload.go +++ b/pkg/cluster/manager/reload.go @@ -103,7 +103,7 @@ func (m *Manager) Reload(name string, gOpt operator.Options, skipRestart, skipCo if err != nil { return err } - if topo.Type() == spec.TopoTypeTiDB { + if topo.Type() == spec.TopoTypeTiDB && !skipRestart { b.UpdateTopology( name, m.specManager.Path(name), @@ -117,11 +117,11 @@ func (m *Manager) Reload(name string, gOpt operator.Options, skipRestart, skipCo b.ParallelStep("+ Refresh monitor configs", gOpt.Force, monitorConfigTasks...) } - tlsCfg, err := topo.TLSConfig(m.specManager.Path(name, spec.TLSCertKeyDir)) - if err != nil { - return err - } if !skipRestart { + tlsCfg, err := topo.TLSConfig(m.specManager.Path(name, spec.TLSCertKeyDir)) + if err != nil { + return err + } b.Func("UpgradeCluster", func(ctx context.Context) error { return operator.Upgrade(ctx, topo, gOpt, tlsCfg) })