Skip to content

Commit

Permalink
Upgrade with explicit version if release version is up-to-date
Browse files Browse the repository at this point in the history
  • Loading branch information
yuxiang-zhang committed Mar 21, 2024
1 parent 76902cd commit e1d1692
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions pkg/actions/nodegroup/upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -266,14 +266,17 @@ func (m *Manager) upgradeUsingStack(ctx context.Context, options UpgradeOptions,
latestReleaseVersion, err := m.getLatestReleaseVersion(ctx, kubernetesVersion, nodegroup)
if err != nil {
return err
}

if latestReleaseVersion != "" {
} else if latestReleaseVersion != "" {
if err := m.updateReleaseVersion(latestReleaseVersion, options.LaunchTemplateVersion, nodegroup, ngResource); err != nil {
return err
}
} else {
}

if ngResource.ReleaseVersion == nil {
ngResource.Version = gfnt.NewString(kubernetesVersion)
logger.Info(fmt.Sprintf("will upgrade nodes to Kubernetes version: %s", ngResource.Version))
} else {
logger.Info(fmt.Sprintf("will upgrade nodes to release version: %s", ngResource.ReleaseVersion))
}
}
if options.LaunchTemplateVersion != "" {
Expand All @@ -282,6 +285,8 @@ func (m *Manager) upgradeUsingStack(ctx context.Context, options UpgradeOptions,

ngResource.ForceUpdateEnabled = gfnt.NewBoolean(options.ForceUpgrade)

logger.Debug("nodegroup resources for upgrade: %+v", ngResource)

logger.Info("upgrading nodegroup version")
if err := updateStack(stack, options.Wait); err != nil {
return err
Expand Down

0 comments on commit e1d1692

Please sign in to comment.