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: Avoid launch template creation loop when switching from launch config and failing #346

Merged
merged 3 commits into from
Feb 11, 2022

Conversation

sahilbadla
Copy link
Contributor

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

closes #340

Endless LaunchTemplate creation loop happens when swtiching from launchConfig to LaunchTemplate.
Fixed the launchTemplate discovery logic to pass latest template config instead of ASG config(that still has launchConfig)

Signed-off-by: sbadla1 <sahil_badla@intuit.com>
@sahilbadla sahilbadla requested review from a team as code owners February 9, 2022 01:56
@@ -238,7 +238,7 @@ func (ctx *EksInstanceGroupContext) CloudDiscovery() error {

if spec.IsLaunchTemplate() {
state.ScalingConfiguration, err = scaling.NewLaunchTemplate(instanceGroup.NamespacedName(), ctx.AwsWorker, &scaling.DiscoverConfigurationInput{
ScalingGroup: targetScalingGroup,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the current implementation discovers the active launch template by the scaling group name, can you look inside NewLaunchTemplate and see if there is a reason this is not happening?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like we are not setting TargetConfigName inside Discover:
https://github.com/sahilbadla/instance-manager/blob/58ad1a253a80900c2a1047c5809ca1d94e300d00/controllers/provisioners/eks/scaling/launchtemplate.go#L58

Can you try that instead?
That way we don't rely on status field, but rather discover the active Launch Template name each time from the scaling group name.

Signed-off-by: sbadla1 <sahil_badla@intuit.com>
Signed-off-by: sbadla1 <sahil_badla@intuit.com>
@eytan-avisror eytan-avisror changed the title bug fix for launchTemplate loop reconcile fix: Avoid launch template creation loop when switching from launch config and failing Feb 10, 2022
@codecov
Copy link

codecov bot commented Feb 10, 2022

Codecov Report

Merging #346 (1b1093d) into master (bda2adc) will increase coverage by 0.02%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #346      +/-   ##
==========================================
+ Coverage   51.15%   51.17%   +0.02%     
==========================================
  Files          33       33              
  Lines        4514     4516       +2     
==========================================
+ Hits         2309     2311       +2     
  Misses       2063     2063              
  Partials      142      142              
Impacted Files Coverage Δ
controllers/provisioners/eks/cloud.go 86.19% <100.00%> (+0.11%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update bda2adc...1b1093d. Read the comment docs.

@eytan-avisror eytan-avisror merged commit 3099305 into keikoproj:master Feb 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Endless LaunchTemplate creation loop when reconcile errors occur
2 participants