Skip to content

Commit 3099305

Browse files
authored
fix: Avoid launch template creation loop when switching from launch config and failing (#346)
* bug fix for launchTemplate loop reconcile Signed-off-by: sbadla1 <[email protected]> * bug fix for launchTemplate loop reconcile Signed-off-by: sbadla1 <[email protected]> * bug fix for launchTemplate loop reconcile Signed-off-by: sbadla1 <[email protected]>
1 parent bda2adc commit 3099305

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

controllers/provisioners/eks/cloud.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,8 @@ func (ctx *EksInstanceGroupContext) CloudDiscovery() error {
226226
if spec.IsLaunchConfiguration() {
227227

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

239240
if spec.IsLaunchTemplate() {
240241
state.ScalingConfiguration, err = scaling.NewLaunchTemplate(instanceGroup.NamespacedName(), ctx.AwsWorker, &scaling.DiscoverConfigurationInput{
241-
ScalingGroup: targetScalingGroup,
242+
ScalingGroup: targetScalingGroup,
243+
TargetConfigName: state.ScalingConfiguration.Name(),
242244
})
243245
if err != nil {
244246
return errors.Wrap(err, "failed to discover launch templates")

0 commit comments

Comments
 (0)