mirror of https://github.com/kubernetes/kops.git
Merge pull request #11958 from olivierpilotte/fix-instance-not-under-asg
check if the instance is under an asg
This commit is contained in:
commit
098a4a91ee
|
|
@ -762,6 +762,10 @@ func getAWSConfigurationMode(c *model.NodeupModelContext) (string, error) {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", fmt.Errorf("error describing instances: %v", err)
|
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)
|
lifecycle := fi.StringValue(result.AutoScalingInstances[0].LifecycleState)
|
||||||
if strings.HasPrefix(lifecycle, "Warmed:") {
|
if strings.HasPrefix(lifecycle, "Warmed:") {
|
||||||
klog.Info("instance is entering warm pool")
|
klog.Info("instance is entering warm pool")
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue