Skip to content

Commit

Permalink
Merge pull request #4830 from fad3t/fix-ng-lt-update
Browse files Browse the repository at this point in the history
🐛 fix upgrade of managed node groups using custom AMIs
  • Loading branch information
k8s-ci-robot authored Mar 7, 2024
2 parents 7def2f0 + 65da70d commit e7c9629
Showing 1 changed file with 6 additions and 6 deletions.
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

0 comments on commit e7c9629

Please sign in to comment.