@@ -17,15 +17,12 @@ limitations under the License.
17
17
package ec2
18
18
19
19
import (
20
- "context"
21
20
"encoding/base64"
22
21
"fmt"
23
22
"sort"
24
23
"strings"
25
- "time"
26
24
27
25
"github.com/aws/aws-sdk-go/aws"
28
- "github.com/aws/aws-sdk-go/aws/request"
29
26
"github.com/aws/aws-sdk-go/service/ec2"
30
27
"github.com/pkg/errors"
31
28
"k8s.io/utils/pointer"
@@ -34,7 +31,6 @@ import (
34
31
"sigs.k8s.io/cluster-api-provider-aws/v2/pkg/cloud/awserrors"
35
32
"sigs.k8s.io/cluster-api-provider-aws/v2/pkg/cloud/converters"
36
33
"sigs.k8s.io/cluster-api-provider-aws/v2/pkg/cloud/filter"
37
- awslogs "sigs.k8s.io/cluster-api-provider-aws/v2/pkg/cloud/logs"
38
34
"sigs.k8s.io/cluster-api-provider-aws/v2/pkg/cloud/scope"
39
35
"sigs.k8s.io/cluster-api-provider-aws/v2/pkg/cloud/services/userdata"
40
36
"sigs.k8s.io/cluster-api-provider-aws/v2/pkg/record"
@@ -591,19 +587,6 @@ func (s *Service) runInstance(role string, i *infrav1.Instance) (*infrav1.Instan
591
587
return nil , errors .Errorf ("no instance returned for reservation %v" , out .GoString ())
592
588
}
593
589
594
- waitTimeout := 1 * time .Minute
595
- s .scope .Debug ("Waiting for instance to be in running state" , "instance-id" , * out .Instances [0 ].InstanceId , "timeout" , waitTimeout .String ())
596
- ctx , cancel := context .WithTimeout (aws .BackgroundContext (), waitTimeout )
597
- defer cancel ()
598
-
599
- if err := s .EC2Client .WaitUntilInstanceRunningWithContext (
600
- ctx ,
601
- & ec2.DescribeInstancesInput {InstanceIds : []* string {out .Instances [0 ].InstanceId }},
602
- request .WithWaiterLogger (awslogs .NewWrapLogr (s .scope .GetLogger ())),
603
- ); err != nil {
604
- s .scope .Debug ("Could not determine if Machine is running. Machine state might be unavailable until next renconciliation." )
605
- }
606
-
607
590
return s .SDKToInstance (out .Instances [0 ])
608
591
}
609
592
0 commit comments