mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-03 17:30:00 +00:00
Merge pull request #6160 from justinsb/aws_dont_list_until_ready
Don't list AWS instances until they are actually ready
This commit is contained in:
commit
ff03b721fe
@ -288,7 +288,20 @@ func (aws *AWSCloud) getInstancesByRegex(regex string) ([]string, error) {
|
|||||||
for _, instance := range reservation.Instances {
|
for _, instance := range reservation.Instances {
|
||||||
// TODO: Push filtering down into EC2 API filter?
|
// TODO: Push filtering down into EC2 API filter?
|
||||||
if !isAlive(&instance) {
|
if !isAlive(&instance) {
|
||||||
glog.V(2).Infof("skipping EC2 instance (not alive): %s", instance.InstanceId)
|
glog.V(2).Infof("skipping EC2 instance (%s): %s",
|
||||||
|
instance.State.Name, instance.InstanceId)
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
// Only return fully-ready instances when listing instances
|
||||||
|
// (vs a query by name, where we will return it if we find it)
|
||||||
|
if instance.State.Name == "pending" {
|
||||||
|
glog.V(2).Infof("skipping EC2 instance (pending): %s", instance.InstanceId)
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
if instance.PrivateDNSName == "" {
|
||||||
|
glog.V(2).Infof("skipping EC2 instance (no PrivateDNSName): %s",
|
||||||
|
instance.InstanceId)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user