Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
Signed-off-by: xhe <xw897002528@gmail.com>
  • Loading branch information
xhebox committed Jan 11, 2024
1 parent c88ed25 commit 999479a
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions pkg/cluster/manager/upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,8 @@ func (m *Manager) Upgrade(name string, clusterVersion string, componentVersions
}

compVersionMsg := ""
for _, comp := range topo.ComponentsByUpdateOrder(base.Version) {
components := topo.ComponentsByUpdateOrder(base.Version)
for _, comp := range components {
// if component version is not specified, use the cluster version or latest("")
oldver := comp.CalculateVersion(base.Version)
version := componentVersions[comp.Name()]
Expand All @@ -104,7 +105,7 @@ func (m *Manager) Upgrade(name string, clusterVersion string, componentVersions
}
}
}
nodeFilter := set.NewStringSet(opt.Nodes...)
components = operator.FilterComponent(components, set.NewStringSet(opt.Roles...))

monitoredOptions := topo.GetMonitoredOptions()
if monitoredOptions != nil {
Expand Down Expand Up @@ -134,13 +135,9 @@ This operation will upgrade %s %s cluster %s to %s:%s`,
}

hasImported := false
for _, comp := range topo.ComponentsByUpdateOrder(base.Version) {
for _, comp := range components {
compName := comp.Name()
version := comp.CalculateVersion(clusterVersion)
instances := operator.FilterInstance(comp.Instances(), nodeFilter)
if len(instances) < 1 {
continue
}

for _, inst := range comp.Instances() {
// Download component from repository
Expand Down

0 comments on commit 999479a

Please sign in to comment.