check if the instance is under an asg

add a comment, remove log
This commit is contained in:
Olivier Pilotte 2021-07-08 09:38:37 -04:00
parent 8aefbb3e29
commit 3db2c0d443
1 changed files with 4 additions and 0 deletions

View File

@ -762,6 +762,10 @@ func getAWSConfigurationMode(c *model.NodeupModelContext) (string, error) {
if err != nil {
return "", fmt.Errorf("error describing instances: %v", err)
}
// If the instance is not a part of an ASG, it won't be in a warm pool either.
if len(result.AutoScalingInstances) < 1 {
return "", nil
}
lifecycle := fi.StringValue(result.AutoScalingInstances[0].LifecycleState)
if strings.HasPrefix(lifecycle, "Warmed:") {
klog.Info("instance is entering warm pool")