Merge pull request #11958 from olivierpilotte/fix-instance-not-under-asg

check if the instance is under an asg
This commit is contained in:
Kubernetes Prow Robot 2021-07-08 09:14:54 -07:00 committed by GitHub
commit 098a4a91ee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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")