@@ -28,11 +28,12 @@ import (
2828 "github.com/aws/aws-sdk-go-v2/aws"
2929 "github.com/aws/aws-sdk-go-v2/service/eks"
3030 ekstypes "github.com/aws/aws-sdk-go-v2/service/eks/types"
31- "github.com/aws/aws-sdk-go/aws/awserr"
31+ "github.com/aws/aws-sdk-go-v2/service/iam"
32+ iamtypes "github.com/aws/aws-sdk-go-v2/service/iam/types"
3233 stsrequest "github.com/aws/aws-sdk-go/aws/request"
3334 "github.com/aws/aws-sdk-go/service/ec2"
34- "github.com/aws/aws-sdk-go/service/iam"
3535 "github.com/aws/aws-sdk-go/service/sts"
36+ "github.com/aws/smithy-go"
3637 "github.com/golang/mock/gomock"
3738 . "github.com/onsi/gomega"
3839 corev1 "k8s.io/api/core/v1"
@@ -797,37 +798,37 @@ func mockedDescribeInstanceCall(ec2Rec *mocks.MockEC2APIMockRecorder) {
797798}
798799
799800func mockedEKSControlPlaneIAMRole (g * WithT , iamRec * mock_iamauth.MockIAMAPIMockRecorder ) {
800- getRoleCall := iamRec .GetRole (& iam.GetRoleInput {
801+ getRoleCall := iamRec .GetRole (gomock . Any (), & iam.GetRoleInput {
801802 RoleName : aws .String ("test-cluster-iam-service-role" ),
802- }).Return (nil , awserr . New ( iam . ErrCodeNoSuchEntityException , " " , nil ) )
803+ }).Return (nil , & smithy. GenericAPIError { Code : "NoSuchEntity " , Message : "" } )
803804
804- createRoleCall := iamRec .CreateRole (gomock .Any ()) .After (getRoleCall ).DoAndReturn (func (input * iam.CreateRoleInput ) (* iam.CreateRoleOutput , error ) {
805+ createRoleCall := iamRec .CreateRole (gomock .Any (), gomock . Any ()) .After (getRoleCall ).DoAndReturn (func (ctx context. Context , input * iam.CreateRoleInput , optFns ... func ( * iam. Options ) ) (* iam.CreateRoleOutput , error ) {
805806 g .Expect (input .RoleName ).To (BeComparableTo (aws .String ("test-cluster-iam-service-role" )))
806807 return & iam.CreateRoleOutput {
807- Role : & iam .Role {
808+ Role : & iamtypes .Role {
808809 RoleName : aws .String ("test-cluster-iam-service-role" ),
809810 Arn : aws .String ("arn:aws:iam::123456789012:role/test-cluster-iam-service-role" ),
810811 Tags : input .Tags ,
811812 },
812813 }, nil
813814 })
814815
815- iamRec .ListAttachedRolePolicies (& iam.ListAttachedRolePoliciesInput {
816+ iamRec .ListAttachedRolePolicies (gomock . Any (), & iam.ListAttachedRolePoliciesInput {
816817 RoleName : aws .String ("test-cluster-iam-service-role" ),
817818 }).After (createRoleCall ).Return (& iam.ListAttachedRolePoliciesOutput {
818- AttachedPolicies : []* iam .AttachedPolicy {},
819+ AttachedPolicies : []iamtypes .AttachedPolicy {},
819820 }, nil )
820821
821- getPolicyCall := iamRec .GetPolicy (& iam.GetPolicyInput {
822+ getPolicyCall := iamRec .GetPolicy (gomock . Any (), & iam.GetPolicyInput {
822823 PolicyArn : aws .String ("arn:aws:iam::aws:policy/AmazonEKSClusterPolicy" ),
823824 }).Return (& iam.GetPolicyOutput {
824825 // This policy is predefined by AWS
825- Policy : & iam .Policy {
826+ Policy : & iamtypes .Policy {
826827 // Fields are not used. Our code only checks for existence of the policy.
827828 },
828829 }, nil )
829830
830- iamRec .AttachRolePolicy (& iam.AttachRolePolicyInput {
831+ iamRec .AttachRolePolicy (gomock . Any (), & iam.AttachRolePolicyInput {
831832 PolicyArn : aws .String ("arn:aws:iam::aws:policy/AmazonEKSClusterPolicy" ),
832833 RoleName : aws .String ("test-cluster-iam-service-role" ),
833834 }).After (getPolicyCall ).Return (& iam.AttachRolePolicyOutput {}, nil )
@@ -840,10 +841,10 @@ func mockedEKSCluster(ctx context.Context, g *WithT, eksRec *mock_eksiface.MockE
840841 Message : aws .String ("cluster not found" ),
841842 })
842843
843- getRoleCall := iamRec .GetRole (& iam.GetRoleInput {
844+ getRoleCall := iamRec .GetRole (gomock . Any (), & iam.GetRoleInput {
844845 RoleName : aws .String ("test-cluster-iam-service-role" ),
845846 }).After (describeClusterCall ).Return (& iam.GetRoleOutput {
846- Role : & iam .Role {
847+ Role : & iamtypes .Role {
847848 RoleName : aws .String ("test-cluster-iam-service-role" ),
848849 Arn : aws .String ("arn:aws:iam::123456789012:role/test-cluster-iam-service-role" ),
849850 },
0 commit comments