Skip to content

Commit

Permalink
cluster: fix tiproxy config and version (#2354)
Browse files Browse the repository at this point in the history
  • Loading branch information
xhebox authored Jan 9, 2024
1 parent 1210bc2 commit 3b246a3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
12 changes: 9 additions & 3 deletions pkg/cluster/spec/tiproxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,15 @@ func (c *TiProxyComponent) Source() string {

// CalculateVersion implements the Component interface
func (c *TiProxyComponent) CalculateVersion(clusterVersion string) string {
// always not follow global version, use ""(latest) by default
version := c.Topology.ComponentVersions.TiProxy
if version == "" {
// always not follow global version
// because tiproxy version is different from clusterVersion
// but "nightly" is effective
if clusterVersion == "nightly" {
version = clusterVersion
}
}
return version
}

Expand Down Expand Up @@ -224,7 +231,6 @@ func (i *TiProxyInstance) checkConfig(
pds = append(pds, pdspec.GetAdvertiseClientURL(enableTLS))
}
cfg["proxy.pd-addrs"] = strings.Join(pds, ",")
cfg["proxy.require-backend-tls"] = false
cfg["proxy.addr"] = utils.JoinHostPort(i.GetListenHost(), i.GetPort())
cfg["api.addr"] = utils.JoinHostPort(i.GetListenHost(), spec.StatusPort)
cfg["log.log-file.filename"] = filepath.Join(paths.Log, "tiproxy.log")
Expand Down Expand Up @@ -311,7 +317,7 @@ func (i *TiProxyInstance) setTLSConfig(ctx context.Context, enableTLS bool, conf
}
}

return nil, nil
return configs, nil
}

var _ RollingUpdateInstance = &TiProxyInstance{}
Expand Down
1 change: 1 addition & 0 deletions pkg/cluster/spec/validate.go
Original file line number Diff line number Diff line change
Expand Up @@ -938,6 +938,7 @@ func (s *Specification) validateTLSEnabled() error {
ComponentTiDB,
ComponentTiKV,
ComponentTiFlash,
ComponentTiProxy,
ComponentPump,
ComponentDrainer,
ComponentCDC,
Expand Down

0 comments on commit 3b246a3

Please sign in to comment.