@@ -22,7 +22,6 @@ import (
2222 "time"
2323
2424 awsv2 "github.com/aws/aws-sdk-go-v2/aws"
25- awsclient "github.com/aws/aws-sdk-go/aws/client"
2625 "github.com/pkg/errors"
2726 corev1 "k8s.io/api/core/v1"
2827 metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
@@ -54,7 +53,7 @@ type ManagedMachinePoolScopeParams struct {
5453 MachinePool * expclusterv1.MachinePool
5554 ControllerName string
5655 Endpoints []ServiceEndpoint
57- Session awsclient. ConfigProvider
56+ Session awsv2. Config
5857 MaxWaitActiveUpdateDelete time.Duration
5958
6059 EnableIAM bool
@@ -88,10 +87,6 @@ func NewManagedMachinePoolScope(params ManagedMachinePoolScopeParams) (*ManagedM
8887 ControlPlane : params .ControlPlane ,
8988 controllerName : params .ControllerName ,
9089 }
91- session , serviceLimiters , err := sessionForClusterWithRegion (params .Client , managedScope , params .ControlPlane .Spec .Region , params .Endpoints , params .Logger )
92- if err != nil {
93- return nil , errors .Errorf ("failed to create aws session: %v" , err )
94- }
9590
9691 sessionv2 , serviceLimitersv2 , err := sessionForClusterWithRegionV2 (params .Client , managedScope , params .ControlPlane .Spec .Region , params .Endpoints , params .Logger )
9792 if err != nil {
@@ -119,10 +114,8 @@ func NewManagedMachinePoolScope(params ManagedMachinePoolScopeParams) (*ManagedM
119114 MachinePool : params .MachinePool ,
120115 MaxWaitActiveUpdateDelete : params .MaxWaitActiveUpdateDelete ,
121116 EC2Scope : params .InfraCluster ,
122- session : session ,
123- sessionV2 : * sessionv2 ,
124- serviceLimiters : serviceLimiters ,
125- serviceLimitersV2 : serviceLimitersv2 ,
117+ session : * sessionv2 ,
118+ serviceLimiters : serviceLimitersv2 ,
126119 controllerName : params .ControllerName ,
127120 enableIAM : params .EnableIAM ,
128121 allowAdditionalRoles : params .AllowAdditionalRoles ,
@@ -143,11 +136,9 @@ type ManagedMachinePoolScope struct {
143136 EC2Scope EC2Scope
144137 MaxWaitActiveUpdateDelete time.Duration
145138
146- session awsclient.ConfigProvider
147- sessionV2 awsv2.Config
148- serviceLimiters throttle.ServiceLimiters
149- serviceLimitersV2 throttle.ServiceLimiters
150- controllerName string
139+ session awsv2.Config
140+ serviceLimiters throttle.ServiceLimiters
141+ controllerName string
151142
152143 enableIAM bool
153144 allowAdditionalRoles bool
@@ -311,16 +302,11 @@ func (s *ManagedMachinePoolScope) ClusterObj() cloud.ClusterObject {
311302 return s .Cluster
312303}
313304
314- // Session returns the AWS SDK session . Used for creating clients.
315- func (s * ManagedMachinePoolScope ) Session () awsclient. ConfigProvider {
305+ // Session returns the AWS SDK V2 config . Used for creating clients.
306+ func (s * ManagedMachinePoolScope ) Session () awsv2. Config {
316307 return s .session
317308}
318309
319- // SessionV2 returns the AWS SDK V2 config. Used for creating clients.
320- func (s * ManagedMachinePoolScope ) SessionV2 () awsv2.Config {
321- return s .sessionV2
322- }
323-
324310// ControllerName returns the name of the controller that
325311// created the ManagedMachinePool.
326312func (s * ManagedMachinePoolScope ) ControllerName () string {
0 commit comments