Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 fix upgrade of managed node groups using custom AMIs #4830

Merged
merged 1 commit into from
Mar 7, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions pkg/cloud/services/eks/nodegroup.go
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,12 @@ func (s *NodegroupService) reconcileNodegroupVersion(ng *eks.Nodegroup) error {
var updateMsg string
// Either update k8s version or AMI version
switch {
case statusLaunchTemplateVersion != nil && *statusLaunchTemplateVersion != *ngLaunchTemplateVersion:
input.LaunchTemplate = &eks.LaunchTemplateSpecification{
Id: s.scope.ManagedMachinePool.Status.LaunchTemplateID,
Version: statusLaunchTemplateVersion,
}
updateMsg = fmt.Sprintf("to launch template version %s", *statusLaunchTemplateVersion)
case specVersion != nil && ngVersion.LessThan(specVersion):
// NOTE: you can only upgrade increments of minor versions. If you want to upgrade 1.14 to 1.16 we
// need to go 1.14-> 1.15 and then 1.15 -> 1.16.
Expand All @@ -356,12 +362,6 @@ func (s *NodegroupService) reconcileNodegroupVersion(ng *eks.Nodegroup) error {
case specAMI != nil && *specAMI != ngAMI:
input.ReleaseVersion = specAMI
updateMsg = fmt.Sprintf("to AMI version %s", *input.ReleaseVersion)
case statusLaunchTemplateVersion != nil && *statusLaunchTemplateVersion != *ngLaunchTemplateVersion:
input.LaunchTemplate = &eks.LaunchTemplateSpecification{
Id: s.scope.ManagedMachinePool.Status.LaunchTemplateID,
Version: statusLaunchTemplateVersion,
}
updateMsg = fmt.Sprintf("to launch template version %s", *statusLaunchTemplateVersion)
}

if err := wait.WaitForWithRetryable(wait.NewBackoff(), func() (bool, error) {
Expand Down