@@ -164,7 +164,7 @@ func (p *DefaultProvider) Get(ctx context.Context, id string) (*Instance, error)
164
164
if err != nil {
165
165
return nil , fmt .Errorf ("failed to describe ec2 instances, %w" , err )
166
166
}
167
- instances , err := instancesFromOutput (out )
167
+ instances , err := instancesFromOutput (ctx , out )
168
168
if err != nil {
169
169
return nil , fmt .Errorf ("getting instances from output, %w" , err )
170
170
}
@@ -202,7 +202,7 @@ func (p *DefaultProvider) List(ctx context.Context) ([]*Instance, error) {
202
202
}
203
203
out .Reservations = append (out .Reservations , page .Reservations ... )
204
204
}
205
- instances , err := instancesFromOutput (out )
205
+ instances , err := instancesFromOutput (ctx , out )
206
206
return instances , cloudprovider .IgnoreNodeClaimNotFoundError (err )
207
207
}
208
208
@@ -612,7 +612,7 @@ func filterExoticInstanceTypes(instanceTypes []*cloudprovider.InstanceType) []*c
612
612
return instanceTypes
613
613
}
614
614
615
- func instancesFromOutput (out * ec2.DescribeInstancesOutput ) ([]* Instance , error ) {
615
+ func instancesFromOutput (ctx context. Context , out * ec2.DescribeInstancesOutput ) ([]* Instance , error ) {
616
616
if len (out .Reservations ) == 0 {
617
617
return nil , cloudprovider .NewNodeClaimNotFoundError (fmt .Errorf ("instance not found" ))
618
618
}
@@ -626,7 +626,7 @@ func instancesFromOutput(out *ec2.DescribeInstancesOutput) ([]*Instance, error)
626
626
sort .Slice (instances , func (i , j int ) bool {
627
627
return aws .ToString (instances [i ].InstanceId ) < aws .ToString (instances [j ].InstanceId )
628
628
})
629
- return lo .Map (instances , func (i ec2types.Instance , _ int ) * Instance { return NewInstance (i ) }), nil
629
+ return lo .Map (instances , func (i ec2types.Instance , _ int ) * Instance { return NewInstance (ctx , i ) }), nil
630
630
}
631
631
632
632
func combineFleetErrors (fleetErrs []ec2types.CreateFleetError ) (errs error ) {
0 commit comments