Skip to content

Commit

Permalink
check for ASG's launch template version instead latest. (#293)
Browse files Browse the repository at this point in the history
Signed-off-by: sbadiger <[email protected]>
  • Loading branch information
shreyas-badiger authored Aug 5, 2021
1 parent c35445d commit 52d80d9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions controllers/upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,7 @@ func (r *RollingUpgradeContext) IsInstanceDrifted(instance *autoscaling.Instance
launchTemplateName = aws.StringValue(scalingGroup.LaunchTemplate.LaunchTemplateName)
instanceTemplateName = aws.StringValue(instance.LaunchTemplate.LaunchTemplateName)
instanceTemplateVersion = aws.StringValue(instance.LaunchTemplate.Version)
templateVersion = awsprovider.GetTemplateLatestVersion(r.Cloud.LaunchTemplates, launchTemplateName)
templateVersion = aws.StringValue(scalingGroup.LaunchTemplate.Version)
)

if !strings.EqualFold(launchTemplateName, instanceTemplateName) {
Expand All @@ -495,7 +495,7 @@ func (r *RollingUpgradeContext) IsInstanceDrifted(instance *autoscaling.Instance
launchTemplateName = aws.StringValue(scalingGroup.MixedInstancesPolicy.LaunchTemplate.LaunchTemplateSpecification.LaunchTemplateName)
instanceTemplateName = aws.StringValue(instance.LaunchTemplate.LaunchTemplateName)
instanceTemplateVersion = aws.StringValue(instance.LaunchTemplate.Version)
templateVersion = awsprovider.GetTemplateLatestVersion(r.Cloud.LaunchTemplates, launchTemplateName)
templateVersion = aws.StringValue(scalingGroup.LaunchTemplate.Version)
)

if !strings.EqualFold(launchTemplateName, instanceTemplateName) {
Expand Down

0 comments on commit 52d80d9

Please sign in to comment.