Skip to content

Commit

Permalink
fix: Avoid launch template creation loop when switching from launch c…
Browse files Browse the repository at this point in the history
…onfig and failing (#346)

* bug fix for launchTemplate loop reconcile

Signed-off-by: sbadla1 <sahil_badla@intuit.com>

* bug fix for launchTemplate loop reconcile

Signed-off-by: sbadla1 <sahil_badla@intuit.com>

* bug fix for launchTemplate loop reconcile

Signed-off-by: sbadla1 <sahil_badla@intuit.com>
  • Loading branch information
sbadla1 authored Feb 11, 2022
1 parent bda2adc commit 3099305
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions controllers/provisioners/eks/cloud.go
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,8 @@ func (ctx *EksInstanceGroupContext) CloudDiscovery() error {
if spec.IsLaunchConfiguration() {

state.ScalingConfiguration, err = scaling.NewLaunchConfiguration(instanceGroup.NamespacedName(), ctx.AwsWorker, &scaling.DiscoverConfigurationInput{
ScalingGroup: targetScalingGroup,
ScalingGroup: targetScalingGroup,
TargetConfigName: state.ScalingConfiguration.Name(),
})
if err != nil {
return errors.Wrap(err, "failed to discover launch configurations")
Expand All @@ -238,7 +239,8 @@ func (ctx *EksInstanceGroupContext) CloudDiscovery() error {

if spec.IsLaunchTemplate() {
state.ScalingConfiguration, err = scaling.NewLaunchTemplate(instanceGroup.NamespacedName(), ctx.AwsWorker, &scaling.DiscoverConfigurationInput{
ScalingGroup: targetScalingGroup,
ScalingGroup: targetScalingGroup,
TargetConfigName: state.ScalingConfiguration.Name(),
})
if err != nil {
return errors.Wrap(err, "failed to discover launch templates")
Expand Down

0 comments on commit 3099305

Please sign in to comment.