Skip to content

Commit 2c09599

Browse files
committed
migrate EKS client from e2e to AWS SDK V2
Signed-off-by: Pankaj Walke <[email protected]>
1 parent 7d985c0 commit 2c09599

File tree

16 files changed

+143
-68
lines changed

16 files changed

+143
-68
lines changed

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ require (
1515
github.com/aws/aws-sdk-go-v2/config v1.27.11
1616
github.com/aws/aws-sdk-go-v2/credentials v1.17.11
1717
github.com/aws/aws-sdk-go-v2/service/eks v1.64.0
18+
github.com/aws/aws-sdk-go-v2/service/iam v1.32.0
1819
github.com/aws/aws-sdk-go-v2/service/s3 v1.53.1
1920
github.com/aws/aws-sdk-go-v2/service/sts v1.28.6
2021
github.com/aws/smithy-go v1.22.2
@@ -84,7 +85,6 @@ require (
8485
github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.5 // indirect
8586
github.com/aws/aws-sdk-go-v2/service/cloudformation v1.50.0 // indirect
8687
github.com/aws/aws-sdk-go-v2/service/ec2 v1.159.0 // indirect
87-
github.com/aws/aws-sdk-go-v2/service/iam v1.32.0 // indirect
8888
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.2 // indirect
8989
github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.3.7 // indirect
9090
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.7 // indirect

test/e2e/shared/aws.go

Lines changed: 66 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,12 @@ import (
3232
"strings"
3333
"time"
3434

35+
awsv2 "github.com/aws/aws-sdk-go-v2/aws"
36+
"github.com/aws/aws-sdk-go-v2/config"
37+
awscredsv2 "github.com/aws/aws-sdk-go-v2/credentials"
38+
"github.com/aws/aws-sdk-go-v2/service/eks"
39+
ekstypes "github.com/aws/aws-sdk-go-v2/service/eks/types"
40+
iamtypes "github.com/aws/aws-sdk-go-v2/service/iam/types"
3541
"github.com/aws/aws-sdk-go/aws"
3642
"github.com/aws/aws-sdk-go/aws/client"
3743
awscreds "github.com/aws/aws-sdk-go/aws/credentials"
@@ -42,7 +48,6 @@ import (
4248
"github.com/aws/aws-sdk-go/service/ec2"
4349
"github.com/aws/aws-sdk-go/service/ecrpublic"
4450
"github.com/aws/aws-sdk-go/service/efs"
45-
"github.com/aws/aws-sdk-go/service/eks"
4651
"github.com/aws/aws-sdk-go/service/elb"
4752
"github.com/aws/aws-sdk-go/service/iam"
4853
"github.com/aws/aws-sdk-go/service/servicequotas"
@@ -408,6 +413,55 @@ func NewAWSSessionWithKey(accessKey *iam.AccessKey) client.ConfigProvider {
408413
return sess
409414
}
410415

416+
func NewAWSSessionV2() *awsv2.Config {
417+
By("Getting an AWS IAM session - from environment")
418+
region, err := credentials.ResolveRegion("")
419+
Expect(err).NotTo(HaveOccurred())
420+
optFns := []func(*config.LoadOptions) error{
421+
config.WithRegion(region),
422+
config.WithClientLogMode(awsv2.LogSigning),
423+
}
424+
cfg, err := config.LoadDefaultConfig(context.Background(), optFns...)
425+
Expect(err).NotTo(HaveOccurred())
426+
_, err = cfg.Credentials.Retrieve(context.Background())
427+
Expect(err).NotTo(HaveOccurred())
428+
return &cfg
429+
}
430+
431+
func NewAWSSessionRepoWithKeyV2(accessKey *iamtypes.AccessKey) *awsv2.Config {
432+
By("Getting an AWS IAM session - from access key")
433+
region, err := credentials.ResolveRegion("us-east-1")
434+
Expect(err).NotTo(HaveOccurred())
435+
staticCredProvider := awscredsv2.NewStaticCredentialsProvider(awsv2.ToString(accessKey.AccessKeyId), awsv2.ToString(accessKey.SecretAccessKey), "")
436+
optFns := []func(*config.LoadOptions) error{
437+
config.WithRegion(region),
438+
config.WithClientLogMode(awsv2.LogSigning),
439+
config.WithCredentialsProvider(staticCredProvider),
440+
}
441+
cfg, err := config.LoadDefaultConfig(context.Background(), optFns...)
442+
Expect(err).NotTo(HaveOccurred())
443+
_, err = cfg.Credentials.Retrieve(context.Background())
444+
Expect(err).NotTo(HaveOccurred())
445+
return &cfg
446+
}
447+
448+
func NewAWSSessionWithKeyV2(accessKey *iamtypes.AccessKey) *awsv2.Config {
449+
By("Getting an AWS IAM session - from access key")
450+
region, err := credentials.ResolveRegion("")
451+
Expect(err).NotTo(HaveOccurred())
452+
staticCredProvider := awscredsv2.NewStaticCredentialsProvider(awsv2.ToString(accessKey.AccessKeyId), awsv2.ToString(accessKey.SecretAccessKey), "")
453+
optFns := []func(*config.LoadOptions) error{
454+
config.WithRegion(region),
455+
config.WithClientLogMode(awsv2.LogSigning),
456+
config.WithCredentialsProvider(staticCredProvider),
457+
}
458+
cfg, err := config.LoadDefaultConfig(context.Background(), optFns...)
459+
Expect(err).NotTo(HaveOccurred())
460+
_, err = cfg.Credentials.Retrieve(context.Background())
461+
Expect(err).NotTo(HaveOccurred())
462+
return &cfg
463+
}
464+
411465
// createCloudFormationStack ensures the cloudformation stack is up to date.
412466
func createCloudFormationStack(prov client.ConfigProvider, t *cfn_bootstrap.Template, tags map[string]string) error {
413467
By(fmt.Sprintf("Creating AWS CloudFormation stack for AWS IAM resources: stack-name=%s", t.Spec.StackName))
@@ -1011,7 +1065,7 @@ func (s *ServiceQuota) updateServiceQuotaRequestStatus(serviceQuotasClient *serv
10111065
}
10121066

10131067
// DumpEKSClusters dumps the EKS clusters in the environment.
1014-
func DumpEKSClusters(_ context.Context, e2eCtx *E2EContext) {
1068+
func DumpEKSClusters(ctx context.Context, e2eCtx *E2EContext) {
10151069
name := "no-bootstrap-cluster"
10161070
if e2eCtx.Environment.BootstrapClusterProxy != nil {
10171071
name = e2eCtx.Environment.BootstrapClusterProxy.GetName()
@@ -1023,36 +1077,36 @@ func DumpEKSClusters(_ context.Context, e2eCtx *E2EContext) {
10231077
fmt.Fprintf(GinkgoWriter, "Folder created for eks clusters: %q\n", logPath)
10241078

10251079
input := &eks.ListClustersInput{}
1026-
var eksClient *eks.EKS
1027-
if e2eCtx.BootstrapUserAWSSession == nil && e2eCtx.AWSSession != nil {
1028-
eksClient = eks.New(e2eCtx.AWSSession)
1029-
} else if e2eCtx.BootstrapUserAWSSession != nil {
1030-
eksClient = eks.New(e2eCtx.BootstrapUserAWSSession)
1080+
var eksClient *eks.Client
1081+
if e2eCtx.BootstrapUserAWSSessionV2 == nil && e2eCtx.AWSSessionV2 != nil {
1082+
eksClient = eks.NewFromConfig(*e2eCtx.NewAWSSessionV2)
1083+
} else if e2eCtx.BootstrapUserAWSSessionV2 != nil {
1084+
eksClient = eks.NewFromConfig(*e2eCtx.BootstrapUserAWSSessionV2)
10311085
} else {
10321086
Fail("Couldn't list EKS clusters: no AWS client was set up (please look at previous errors)")
10331087
return
10341088
}
10351089

1036-
output, err := eksClient.ListClusters(input)
1090+
output, err := eksClient.ListClusters(ctx, input)
10371091
if err != nil {
10381092
fmt.Fprintf(GinkgoWriter, "Couldn't list EKS clusters: err=%s\n", err)
10391093
return
10401094
}
10411095

10421096
for _, clusterName := range output.Clusters {
10431097
describeInput := &eks.DescribeClusterInput{
1044-
Name: clusterName,
1098+
Name: aws.String(clusterName),
10451099
}
1046-
describeOutput, err := eksClient.DescribeCluster(describeInput)
1100+
describeOutput, err := eksClient.DescribeCluster(ctx, describeInput)
10471101
if err != nil {
1048-
fmt.Fprintf(GinkgoWriter, "Couldn't describe EKS clusters: name=%q err=%s\n", *clusterName, err)
1102+
fmt.Fprintf(GinkgoWriter, "Couldn't describe EKS clusters: name=%q err=%s\n", clusterName, err)
10491103
continue
10501104
}
10511105
dumpEKSCluster(describeOutput.Cluster, logPath)
10521106
}
10531107
}
10541108

1055-
func dumpEKSCluster(cluster *eks.Cluster, logPath string) {
1109+
func dumpEKSCluster(cluster *ekstypes.Cluster, logPath string) {
10561110
clusterYAML, err := yaml.Marshal(cluster)
10571111
if err != nil {
10581112
fmt.Fprintf(GinkgoWriter, "Couldn't marshal cluster to yaml: name=%q err=%s\n", *cluster.Name, err)

test/e2e/shared/context.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import (
2323
"context"
2424
"time"
2525

26+
awsv2 "github.com/aws/aws-sdk-go-v2/aws"
2627
"github.com/aws/aws-sdk-go/aws/client"
2728
"github.com/aws/aws-sdk-go/service/iam"
2829
"github.com/awslabs/goformation/v4/cloudformation"
@@ -64,9 +65,13 @@ type E2EContext struct {
6465
Environment RuntimeEnvironment
6566
// AWSSession is the AWS session for the tests.
6667
AWSSession client.ConfigProvider
68+
// AWSSessionV2 is the AWS SDK V2 session for the tests. This is until the V2 migration is done.
69+
AWSSessionV2 *awsv2.Config
6770
// BootstrapUserAWSSession is the AWS session for the bootstrap user.
6871
BootstrapUserAWSSession client.ConfigProvider
69-
// IsManaged indicates that this is for the managed part of the provider.
72+
// BootstrapUserAWSSessionV2 is the AWS SDK V2 session for the bootstrap user.
73+
BootstrapUserAWSSessionV2 *awsv2.Config
74+
// IsManaged indicates that this is for the managed part of the provider. This is until the V2 migration is done.
7075
IsManaged bool
7176
// CloudFormationTemplate is the rendered template created for the test.
7277
CloudFormationTemplate *cloudformation.Template

test/e2e/shared/suite.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ import (
3131
"strconv"
3232
"time"
3333

34+
iamtypes "github.com/aws/aws-sdk-go-v2/service/iam/types"
3435
"github.com/aws/aws-sdk-go/service/iam"
3536
"github.com/gofrs/flock"
3637
. "github.com/onsi/ginkgo/v2"
@@ -129,6 +130,7 @@ func Node1BeforeSuite(e2eCtx *E2EContext) []byte {
129130

130131
Expect(err).NotTo(HaveOccurred())
131132
e2eCtx.AWSSession = NewAWSSession()
133+
e2eCtx.AWSSessionV2 = NewAWSSessionV2()
132134

133135
logAccountDetails(e2eCtx.AWSSession)
134136

@@ -156,6 +158,12 @@ func Node1BeforeSuite(e2eCtx *E2EContext) []byte {
156158
ensureSSHKeyPair(e2eCtx.AWSSession, DefaultSSHKeyPairName)
157159
e2eCtx.Environment.BootstrapAccessKey = newUserAccessKey(e2eCtx.AWSSession, bootstrapTemplate.Spec.BootstrapUser.UserName)
158160
e2eCtx.BootstrapUserAWSSession = NewAWSSessionWithKey(e2eCtx.Environment.BootstrapAccessKey)
161+
// v2AccessKey can be removed after AWS SDK V2 Migration
162+
v2AccessKey := &iamtypes.AccessKey{
163+
AccessKeyId: e2eCtx.Environment.BootstrapAccessKey.AccessKeyId,
164+
SecretAccessKey: e2eCtx.Environment.BootstrapAccessKey.SecretAccessKey,
165+
}
166+
e2eCtx.BootstrapUserAWSSessionV2 = NewAWSSessionWithKeyV2(v2AccessKey)
159167
Expect(ensureTestImageUploaded(e2eCtx)).NotTo(HaveOccurred())
160168

161169
// Image ID is needed when using a CI Kubernetes version. This is used in conformance test and upgrade to main test.
@@ -224,12 +232,19 @@ func AllNodesBeforeSuite(e2eCtx *E2EContext, data []byte) {
224232
e2eCtx.Environment.BootstrapClusterProxy = framework.NewClusterProxy("bootstrap", conf.KubeconfigPath, e2eCtx.Environment.Scheme)
225233
e2eCtx.E2EConfig = &conf.E2EConfig
226234
e2eCtx.BootstrapUserAWSSession = NewAWSSessionWithKey(conf.BootstrapAccessKey)
235+
// v2AccessKey can be removed after AWS SDK V2 Migration
236+
v2AccessKey := &iamtypes.AccessKey{
237+
AccessKeyId: &e2eCtx.Environment.BootstrapAccessKey.AccessKeyId,
238+
SecretAccessKey: &e2eCtx.Environment.BootstrapAccessKey.SecretAccessKey,
239+
}
240+
e2eCtx.BootstrapUserAWSSessionV2 = NewAWSSessionWithKeyV2(v2AccessKey)
227241
e2eCtx.Settings.FileLock = flock.New(ResourceQuotaFilePath)
228242
e2eCtx.Settings.KubetestConfigFilePath = conf.KubetestConfigFilePath
229243
e2eCtx.Settings.UseCIArtifacts = conf.UseCIArtifacts
230244
e2eCtx.Settings.GinkgoNodes = conf.GinkgoNodes
231245
e2eCtx.Settings.GinkgoSlowSpecThreshold = conf.GinkgoSlowSpecThreshold
232246
e2eCtx.AWSSession = NewAWSSession()
247+
e2eCtx.AWSSessionV2 = NewAWSSessionV2()
233248
azs := GetAvailabilityZones(e2eCtx.AWSSession)
234249
SetEnvVar(AwsAvailabilityZone1, *azs[0].ZoneName, false)
235250
SetEnvVar(AwsAvailabilityZone2, *azs[1].ZoneName, false)

test/e2e/suites/managed/addon.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ import (
2323
"context"
2424
"fmt"
2525

26-
"github.com/aws/aws-sdk-go/aws/client"
27-
"github.com/aws/aws-sdk-go/service/eks"
26+
awsv2 "github.com/aws/aws-sdk-go-v2/aws"
27+
ekstypes "github.com/aws/aws-sdk-go-v2/service/eks/types"
2828
. "github.com/onsi/ginkgo/v2"
2929
. "github.com/onsi/gomega"
3030
corev1 "k8s.io/api/core/v1"
@@ -38,7 +38,7 @@ import (
3838
type CheckAddonExistsSpecInput struct {
3939
E2EConfig *clusterctl.E2EConfig
4040
BootstrapClusterProxy framework.ClusterProxy
41-
AWSSession client.ConfigProvider
41+
AWSSession *awsv2.Config
4242
Namespace *corev1.Namespace
4343
ClusterName string
4444
AddonName string
@@ -67,12 +67,12 @@ func CheckAddonExistsSpec(ctx context.Context, inputGetter func() CheckAddonExis
6767
}, input.E2EConfig.GetIntervals("", "wait-client-request")...).Should(Succeed(), "eventually failed trying to get the AWSManagedControlPlane")
6868

6969
By(fmt.Sprintf("Checking EKS addon %s is installed on cluster %s and is active", input.AddonName, input.ClusterName))
70-
waitForEKSAddonToHaveStatus(waitForEKSAddonToHaveStatusInput{
70+
waitForEKSAddonToHaveStatus(ctx, waitForEKSAddonToHaveStatusInput{
7171
ControlPlane: controlPlane,
7272
AWSSession: input.AWSSession,
7373
AddonName: input.AddonName,
7474
AddonVersion: input.AddonVersion,
75-
AddonStatus: []string{eks.AddonStatusActive, eks.AddonStatusDegraded},
75+
AddonStatus: []string{string(ekstypes.AddonStatusActive), string(ekstypes.AddonStatusDegraded)},
7676
}, input.E2EConfig.GetIntervals("", "wait-addon-status")...)
7777

7878
if input.AddonConfiguration != "" {

test/e2e/suites/managed/addon_helpers.go

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,10 @@ limitations under the License.
2020
package managed
2121

2222
import (
23+
"context"
2324
"fmt"
2425

25-
"github.com/aws/aws-sdk-go/aws/client"
26+
"github.com/aws/aws-sdk-go-v2/aws"
2627
"github.com/onsi/ginkgo/v2"
2728
. "github.com/onsi/gomega"
2829

@@ -31,13 +32,13 @@ import (
3132

3233
type waitForEKSAddonToHaveStatusInput struct {
3334
ControlPlane *ekscontrolplanev1.AWSManagedControlPlane
34-
AWSSession client.ConfigProvider
35+
AWSSession *aws.Config
3536
AddonName string
3637
AddonVersion string
3738
AddonStatus []string
3839
}
3940

40-
func waitForEKSAddonToHaveStatus(input waitForEKSAddonToHaveStatusInput, intervals ...interface{}) {
41+
func waitForEKSAddonToHaveStatus(ctx context.Context, input waitForEKSAddonToHaveStatusInput, intervals ...interface{}) {
4142
Expect(input.ControlPlane).ToNot(BeNil(), "Invalid argument. input.ControlPlane can't be nil")
4243
Expect(input.AWSSession).ToNot(BeNil(), "Invalid argument. input.AWSSession can't be nil")
4344
Expect(input.AddonName).ShouldNot(BeEmpty(), "Invalid argument. input.AddonName can't be empty")
@@ -47,7 +48,7 @@ func waitForEKSAddonToHaveStatus(input waitForEKSAddonToHaveStatusInput, interva
4748
ginkgo.By(fmt.Sprintf("Ensuring EKS addon %s has status in %q for EKS cluster %s", input.AddonName, input.AddonStatus, input.ControlPlane.Spec.EKSClusterName))
4849

4950
Eventually(func() (bool, error) {
50-
installedAddon, err := getEKSClusterAddon(input.ControlPlane.Spec.EKSClusterName, input.AddonName, input.AWSSession)
51+
installedAddon, err := getEKSClusterAddon(ctx, input.ControlPlane.Spec.EKSClusterName, input.AddonName, input.AWSSession)
5152
if err != nil {
5253
return false, err
5354
}
@@ -59,7 +60,7 @@ func waitForEKSAddonToHaveStatus(input waitForEKSAddonToHaveStatusInput, interva
5960
for i := range input.AddonStatus {
6061
wantedStatus := input.AddonStatus[i]
6162

62-
if wantedStatus == *installedAddon.Status {
63+
if wantedStatus == installedAddon.Status {
6364
return true, nil
6465
}
6566
}
@@ -70,7 +71,7 @@ func waitForEKSAddonToHaveStatus(input waitForEKSAddonToHaveStatusInput, interva
7071

7172
type checkEKSAddonConfigurationInput struct {
7273
ControlPlane *ekscontrolplanev1.AWSManagedControlPlane
73-
AWSSession client.ConfigProvider
74+
AWSSession *aws.Config
7475
AddonName string
7576
AddonVersion string
7677
AddonConfiguration string

test/e2e/suites/managed/cluster.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import (
2525
"fmt"
2626
"time"
2727

28-
"github.com/aws/aws-sdk-go/aws/client"
28+
"github.com/aws/aws-sdk-go-v2/aws"
2929
"github.com/onsi/ginkgo/v2"
3030
. "github.com/onsi/gomega"
3131
corev1 "k8s.io/api/core/v1"
@@ -43,7 +43,7 @@ type ManagedClusterSpecInput struct {
4343
E2EConfig *clusterctl.E2EConfig
4444
ConfigClusterFn DefaultConfigClusterFn
4545
BootstrapClusterProxy framework.ClusterProxy
46-
AWSSession client.ConfigProvider
46+
AWSSession *aws.Config
4747
Namespace *corev1.Namespace
4848
ClusterName string
4949
Flavour string
@@ -87,7 +87,7 @@ func ManagedClusterSpec(ctx context.Context, inputGetter func() ManagedClusterSp
8787

8888
ginkgo.By("Checking EKS cluster is active")
8989
eksClusterName := getEKSClusterName(input.Namespace.Name, input.ClusterName)
90-
verifyClusterActiveAndOwned(eksClusterName, input.AWSSession)
90+
verifyClusterActiveAndOwned(ctx, eksClusterName, input.AWSSession)
9191

9292
if input.CluserSpecificRoles {
9393
ginkgo.By("Checking that the cluster specific IAM role exists")

test/e2e/suites/managed/control_plane.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import (
2323
"context"
2424
"fmt"
2525

26-
"github.com/aws/aws-sdk-go/aws/client"
26+
"github.com/aws/aws-sdk-go-v2/aws"
2727
"github.com/onsi/ginkgo/v2"
2828
. "github.com/onsi/gomega"
2929
corev1 "k8s.io/api/core/v1"
@@ -38,7 +38,7 @@ import (
3838
// UpgradeControlPlaneVersionSpecInput is the input type for UpgradeControlPlaneVersionSpec.
3939
type UpgradeControlPlaneVersionSpecInput struct {
4040
E2EConfig *clusterctl.E2EConfig
41-
AWSSession client.ConfigProvider
41+
AWSSession *aws.Config
4242
BootstrapClusterProxy framework.ClusterProxy
4343
ClusterName string
4444
Namespace *corev1.Namespace

test/e2e/suites/managed/control_plane_helpers.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ import (
2424
"fmt"
2525
"time"
2626

27-
"github.com/aws/aws-sdk-go/aws/client"
28-
"github.com/aws/aws-sdk-go/service/eks"
27+
"github.com/aws/aws-sdk-go-v2/aws"
28+
ekstypes "github.com/aws/aws-sdk-go-v2/service/eks/types"
2929
. "github.com/onsi/ginkgo/v2"
3030
. "github.com/onsi/gomega"
3131
"k8s.io/apimachinery/pkg/util/version"
@@ -37,7 +37,7 @@ import (
3737

3838
type waitForControlPlaneToBeUpgradedInput struct {
3939
ControlPlane *ekscontrolplanev1.AWSManagedControlPlane
40-
AWSSession client.ConfigProvider
40+
AWSSession *aws.Config
4141
UpgradeVersion string
4242
}
4343

@@ -57,10 +57,10 @@ func waitForControlPlaneToBeUpgraded(input waitForControlPlaneToBeUpgradedInput,
5757
return false, err
5858
}
5959

60-
switch *cluster.Status {
61-
case eks.ClusterStatusUpdating:
60+
switch cluster.Status {
61+
case ekstypes.ClusterStatusUpdating:
6262
return false, nil
63-
case eks.ClusterStatusActive:
63+
case ekstypes.ClusterStatusActive:
6464
if *cluster.Version == expectedVersion {
6565
return true, nil
6666
}

test/e2e/suites/managed/eks_ipv6_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ var _ = ginkgo.Describe("[managed] [general] [ipv6] EKS cluster tests", func() {
6666
E2EConfig: e2eCtx.E2EConfig,
6767
ConfigClusterFn: defaultConfigCluster,
6868
BootstrapClusterProxy: e2eCtx.Environment.BootstrapClusterProxy,
69-
AWSSession: e2eCtx.BootstrapUserAWSSession,
69+
AWSSession: e2eCtx.BootstrapUserAWSSessionV2,
7070
Namespace: namespace,
7171
ClusterName: clusterName,
7272
Flavour: EKSIPv6ClusterFlavor,

0 commit comments

Comments
 (0)