Skip to content

Commit c65596b

Browse files
fix compilation error
1 parent 1e22f5e commit c65596b

File tree

4 files changed

+12
-16
lines changed

4 files changed

+12
-16
lines changed

controlplane/rosa/controllers/rosacontrolplane_controller.go

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,7 @@ import (
2929
"strings"
3030
"time"
3131

32-
stsv2 "github.com/aws/aws-sdk-go-v2/service/sts"
33-
sts "github.com/aws/aws-sdk-go/service/sts"
34-
"github.com/aws/aws-sdk-go/service/sts/stsiface"
32+
"github.com/aws/aws-sdk-go-v2/service/sts"
3533
"github.com/google/go-cmp/cmp"
3634
idputils "github.com/openshift-online/ocm-common/pkg/idp/utils"
3735
cmv1 "github.com/openshift-online/ocm-sdk-go/clustersmgmt/v1"
@@ -92,7 +90,7 @@ type ROSAControlPlaneReconciler struct {
9290
WatchFilterValue string
9391
WaitInfraPeriod time.Duration
9492
Endpoints []scope.ServiceEndpoint
95-
NewStsClient func(cloud.ScopeUsage, cloud.Session, logger.Wrapper, runtime.Object) stsiface.STSAPI
93+
NewStsClient func(cloud.ScopeUsage, cloud.Session, logger.Wrapper, runtime.Object) *sts.Client
9694
NewOCMClient func(ctx context.Context, rosaScope *scope.ROSAControlPlaneScope) (rosa.OCMClient, error)
9795
// Exposing the restClientConfig for integration test. No need to initialize.
9896
restClientConfig *restclient.Config
@@ -1132,8 +1130,8 @@ func buildAPIEndpoint(cluster *cmv1.Cluster) (*clusterv1.APIEndpoint, error) {
11321130
}
11331131

11341132
// TODO: Remove this and update the aws-sdk lib to v2.
1135-
func convertStsV2(identity *sts.GetCallerIdentityOutput) *stsv2.GetCallerIdentityOutput {
1136-
return &stsv2.GetCallerIdentityOutput{
1133+
func convertStsV2(identity *sts.GetCallerIdentityOutput) *sts.GetCallerIdentityOutput {
1134+
return &sts.GetCallerIdentityOutput{
11371135
Account: identity.Account,
11381136
Arn: identity.Arn,
11391137
UserId: identity.UserId,

exp/controllers/rosamachinepool_controller.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77

88
"github.com/aws/aws-sdk-go-v2/service/ec2"
99
ec2types "github.com/aws/aws-sdk-go-v2/service/ec2/types"
10-
"github.com/aws/aws-sdk-go/service/sts/stsiface"
10+
"github.com/aws/aws-sdk-go-v2/service/sts"
1111
"github.com/blang/semver"
1212
"github.com/google/go-cmp/cmp"
1313
"github.com/google/go-cmp/cmp/cmpopts"
@@ -52,7 +52,7 @@ type ROSAMachinePoolReconciler struct {
5252
Recorder record.EventRecorder
5353
WatchFilterValue string
5454
Endpoints []scope.ServiceEndpoint
55-
NewStsClient func(cloud.ScopeUsage, cloud.Session, logger.Wrapper, runtime.Object) stsiface.STSAPI
55+
NewStsClient func(cloud.ScopeUsage, cloud.Session, logger.Wrapper, runtime.Object) *sts.Client
5656
NewOCMClient func(ctx context.Context, rosaScope *scope.ROSAControlPlaneScope) (rosa.OCMClient, error)
5757
}
5858

pkg/cloud/scope/rosacontrolplane.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@ import (
2121
"fmt"
2222

2323
awsv2 "github.com/aws/aws-sdk-go-v2/aws"
24-
"github.com/aws/aws-sdk-go/service/sts"
25-
"github.com/aws/aws-sdk-go/service/sts/stsiface"
24+
"github.com/aws/aws-sdk-go-v2/service/sts"
2625
"github.com/pkg/errors"
2726
corev1 "k8s.io/api/core/v1"
2827
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
@@ -47,7 +46,7 @@ type ROSAControlPlaneScopeParams struct {
4746
ControlPlane *rosacontrolplanev1.ROSAControlPlane
4847
ControllerName string
4948
Endpoints []ServiceEndpoint
50-
NewStsClient func(cloud.ScopeUsage, cloud.Session, logger.Wrapper, runtime.Object) stsiface.STSAPI
49+
NewStsClient func(cloud.ScopeUsage, cloud.Session, logger.Wrapper, runtime.Object) *sts.Client
5150
}
5251

5352
// NewROSAControlPlaneScope creates a new ROSAControlPlaneScope from the supplied parameters.
@@ -93,7 +92,7 @@ func NewROSAControlPlaneScope(params ROSAControlPlaneScopeParams) (*ROSAControlP
9392
managedScope.serviceLimitersV2 = serviceLimitersv2
9493

9594
stsClient := params.NewStsClient(managedScope, managedScope, managedScope, managedScope.ControlPlane)
96-
identity, err := stsClient.GetCallerIdentity(&sts.GetCallerIdentityInput{})
95+
identity, err := stsClient.GetCallerIdentity(context.TODO(), &sts.GetCallerIdentityInput{})
9796
if err != nil {
9897
return nil, fmt.Errorf("failed to identify the AWS caller: %w", err)
9998
}

pkg/cloud/services/s3/s3.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,8 @@ import (
2828

2929
"github.com/aws/aws-sdk-go-v2/service/s3"
3030
"github.com/aws/aws-sdk-go-v2/service/s3/types"
31+
"github.com/aws/aws-sdk-go-v2/service/sts"
3132
"github.com/aws/aws-sdk-go/aws"
32-
"github.com/aws/aws-sdk-go/service/sts"
33-
"github.com/aws/aws-sdk-go/service/sts/stsiface"
3433
"github.com/pkg/errors"
3534
"k8s.io/utils/ptr"
3635

@@ -53,7 +52,7 @@ type Service struct {
5352
scope scope.S3Scope
5453
S3Client S3API
5554
S3PresignClient *s3.PresignClient
56-
STSClient stsiface.STSAPI
55+
STSClient *sts.Client
5756
}
5857

5958
// S3API is the subset of the AWS S3 API that is used by CAPA.
@@ -512,7 +511,7 @@ func (s *Service) tagBucket(ctx context.Context, bucketName string) error {
512511
}
513512

514513
func (s *Service) bucketPolicy(bucketName string) (string, error) {
515-
accountID, err := s.STSClient.GetCallerIdentity(&sts.GetCallerIdentityInput{})
514+
accountID, err := s.STSClient.GetCallerIdentity(context.TODO(), &sts.GetCallerIdentityInput{})
516515
if err != nil {
517516
return "", errors.Wrap(err, "getting account ID")
518517
}

0 commit comments

Comments
 (0)