AWSMachinePool reconciliation stuck if ASG could not be created #4655
Labels
kind/bug
Categorizes issue or PR as related to a bug.
needs-priority
triage/accepted
Indicates an issue or PR is ready to be actively worked on.
/kind bug
What steps did you take and what happened:
We created a new cluster having a
AWSMachinePool
. Upon adding a secondAWSMachinePool
, for some reason, the IAM instance profile wasn't ready/found yet and the ASG creation failed. That's out of scope for the issue. Just mentioning the error for completeness and visibility:This means that the
AWSMachinePool
reconciler had successfully created the launch template (and set the IAM instance profile name on the launch template), but then failed on ASG creation.The problem is that reconciliation is now stuck due to a bug: on next
Reconcile
attempt,ReconcileLaunchTemplate
detects a diff, callscanUpdateLaunchTemplate
and that in turn callsCanStartASGInstanceRefresh
. In there, an AWS requestDescribeInstanceRefreshesInput{AutoScalingGroupName: aws.String(scope.Name())}
is made and fails because the ASG doesn’t exist yet. The error is:We must handle, log and ignore that error. If the ASG does not exist,
CanStartASGInstanceRefresh
should return false. OrReconcileLaunchTemplate
should not even consider instance refresh through some other means.What did you expect to happen:
Reconciliation continues and eventually succeeds.
Environment:
The text was updated successfully, but these errors were encountered: