Skip to content

Commit

Permalink
Merge 6a4c5d4 into a614582
Browse files Browse the repository at this point in the history
  • Loading branch information
xhebox authored Jan 12, 2024
2 parents a614582 + 6a4c5d4 commit 0bc8dd9
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions pkg/cluster/manager/upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,17 @@ func (m *Manager) Upgrade(name string, clusterVersion string, componentVersions
compVersionMsg := ""
for _, comp := range topo.ComponentsByUpdateOrder(base.Version) {
// if component version is not specified, use the cluster version or latest("")
oldver := comp.CalculateVersion(base.Version)
version := componentVersions[comp.Name()]
if version != "" {
comp.SetVersion(version)
}
if len(comp.Instances()) > 0 {
compVersionMsg += fmt.Sprintf("\nwill upgrade component %19s to \"%s\",", "\""+comp.Name()+"\"", comp.CalculateVersion(clusterVersion))
calver := comp.CalculateVersion(clusterVersion)
if comp.Role() != spec.ComponentTiProxy || calver != oldver {
opt.Roles = append(opt.Roles, comp.Role())
if len(comp.Instances()) > 0 {
compVersionMsg += fmt.Sprintf("\nwill upgrade and restart component \"%19s\" to \"%s\",", comp.Name(), calver)
}
}
}
monitoredOptions := topo.GetMonitoredOptions()
Expand Down

0 comments on commit 0bc8dd9

Please sign in to comment.