From f1e5172acb73a34f3d5c6e442f5d4d5ed805cb8e Mon Sep 17 00:00:00 2001 From: nexustar Date: Wed, 8 Nov 2023 17:50:15 +0800 Subject: [PATCH] tiproxy not use nightly by default --- components/playground/main.go | 1 + components/playground/playground.go | 2 +- pkg/cluster/spec/tiproxy.go | 6 ++---- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/components/playground/main.go b/components/playground/main.go index d6419c100e..fb94016bab 100644 --- a/components/playground/main.go +++ b/components/playground/main.go @@ -335,6 +335,7 @@ If you'd like to use a TiDB version other than %s, cancel and retry with the fol rootCmd.Flags().StringVar(&options.TiKV.BinPath, "kv.binpath", "", "TiKV instance binary path") rootCmd.Flags().StringVar(&options.PD.BinPath, "pd.binpath", "", "PD instance binary path") rootCmd.Flags().StringVar(&options.TiProxy.BinPath, "tiproxy.binpath", "", "TiProxy instance binary path") + rootCmd.Flags().StringVar(&options.TiProxy.Version, "tiproxy.version", "", "TiProxy instance version") rootCmd.Flags().StringVar(&options.TiFlash.BinPath, "tiflash.binpath", "", "TiFlash instance binary path, when --mode=tidb-disagg this will set binary path for both Write Node and Compute Node") rootCmd.Flags().StringVar(&options.TiFlashWrite.BinPath, "tiflash.write.binpath", "", "TiFlash Write instance binary path, available when --mode=tidb-disagg, take precedence over --tiflash.binpath") rootCmd.Flags().StringVar(&options.TiFlashCompute.BinPath, "tiflash.compute.binpath", "", "TiFlash Compute instance binary path, available when --mode=tidb-disagg, take precedence over --tiflash.binpath") diff --git a/components/playground/playground.go b/components/playground/playground.go index 4df08b60af..ca5005292e 100644 --- a/components/playground/playground.go +++ b/components/playground/playground.go @@ -881,7 +881,7 @@ func (p *Playground) bindVersion(comp string, version string) (bindVersion strin case spec.ComponentTiKVCDC: return p.bootOptions.TiKVCDC.Version case spec.ComponentTiProxy: - return "nightly" + return p.bootOptions.TiProxy.Version default: return version } diff --git a/pkg/cluster/spec/tiproxy.go b/pkg/cluster/spec/tiproxy.go index 9d65ffa886..15d167ef94 100644 --- a/pkg/cluster/spec/tiproxy.go +++ b/pkg/cluster/spec/tiproxy.go @@ -133,10 +133,7 @@ func (c *TiProxyComponent) Role() string { func (c *TiProxyComponent) CalculateVersion(clusterVersion string) string { // always not follow global version, use ""(latest) by default version := c.Topology.ComponentVersions.TiProxy - if version != "" { - return version - } - return "nightly" + return version } // SetVersion implements Component interface. @@ -173,6 +170,7 @@ func (c *TiProxyComponent) Instances() []Instance { UptimeFn: func(_ context.Context, timeout time.Duration, tlsCfg *tls.Config) time.Duration { return proxyUptimeByHost(s.Host, s.StatusPort, timeout, tlsCfg) }, + Component: c, }, c.Topology} ins = append(ins, instance)