From 08de4154af83d842ea34b11dd1b8e97c6c9a5d57 Mon Sep 17 00:00:00 2001 From: nithyatsu Date: Thu, 5 Dec 2024 18:09:39 -0800 Subject: [PATCH] wip --- .github/workflows/functional-test-cloud.yaml | 16 ++++++++-------- test/functional-portable/ucp/cloud/aws_test.go | 6 ++---- test/rp/rptest.go | 7 ++----- 3 files changed, 12 insertions(+), 17 deletions(-) diff --git a/.github/workflows/functional-test-cloud.yaml b/.github/workflows/functional-test-cloud.yaml index 9a99b4b240..fa8eacfd32 100644 --- a/.github/workflows/functional-test-cloud.yaml +++ b/.github/workflows/functional-test-cloud.yaml @@ -550,14 +550,14 @@ jobs: with: version: ${{ env.HELM_VER }} - # this step is to configure the aws credentials for github actions. - # The role-to-assume is the role that the github action will assume to execute aws commands. - # - name: configure aws credentials using assumed role - # uses: aws-actions/configure-aws-credentials@v1.7.0 - # with: - # role-to-assume: arn:aws:iam::${{ env.AWS_ACCOUNT_ID }}:role/radius_func_test #TODO: change to reflect ARN of the role to assume craeted in functional test account - # role-session-name: GitHub_to_AWS_via_FederatedOIDC - # aws-region: ${{ env.AWS_REGION }} + #this step is to configure the aws credentials for github actions. + #The role-to-assume is the role that the github action will assume to execute aws commands. + - name: configure aws credentials using assumed role + uses: aws-actions/configure-aws-credentials@v1.7.0 + with: + role-to-assume: arn:aws:iam::${{ env.AWS_ACCOUNT_ID }}:role/radius_func_test #TODO: change to reflect ARN of the role to assume craeted in functional test account + role-session-name: GitHub_to_AWS_via_FederatedOIDC + aws-region: ${{ env.AWS_REGION }} # create kind cluster with OIDC provider. diff --git a/test/functional-portable/ucp/cloud/aws_test.go b/test/functional-portable/ucp/cloud/aws_test.go index 2c3f48df3c..ec5b6b5e79 100644 --- a/test/functional-portable/ucp/cloud/aws_test.go +++ b/test/functional-portable/ucp/cloud/aws_test.go @@ -29,9 +29,7 @@ import ( awsgo "github.com/aws/aws-sdk-go-v2/aws" awsconfig "github.com/aws/aws-sdk-go-v2/config" - "github.com/aws/aws-sdk-go-v2/credentials/stscreds" "github.com/aws/aws-sdk-go-v2/service/cloudcontrol" - "github.com/aws/aws-sdk-go-v2/service/sts" "github.com/google/uuid" "github.com/radius-project/radius/pkg/ucp/api/v20231001preview" "github.com/radius-project/radius/pkg/ucp/aws" @@ -152,12 +150,12 @@ func setupTestAWSResource(t *testing.T, ctx context.Context, resourceName string // Test setup - Create AWS resource using AWS APIs cfg, err := awsconfig.LoadDefaultConfig(ctx) require.NoError(t, err) - //var awsClient ucp_aws.AWSCloudControlClient = cloudcontrol.NewFromConfig(cfg) + /* var awsClient ucp_aws.AWSCloudControlClient = cloudcontrol.NewFromConfig(cfg) stsClient := sts.NewFromConfig(cfg) roleARN := "arn:aws:iam::179022619019:role/radius_func_test" creds := stscreds.NewAssumeRoleProvider(stsClient, roleARN) - cfg.Credentials = awsgo.NewCredentialsCache(creds) + cfg.Credentials = awsgo.NewCredentialsCache(creds)*/ var awsClient ucp_aws.AWSCloudControlClient = cloudcontrol.NewFromConfig(cfg) desiredState := map[string]any{ diff --git a/test/rp/rptest.go b/test/rp/rptest.go index 4cf1eab81f..6969cb153c 100644 --- a/test/rp/rptest.go +++ b/test/rp/rptest.go @@ -25,10 +25,7 @@ import ( "testing" "time" - "github.com/aws/aws-sdk-go-v2/aws" - "github.com/aws/aws-sdk-go-v2/credentials/stscreds" "github.com/aws/aws-sdk-go-v2/service/cloudcontrol" - "github.com/aws/aws-sdk-go-v2/service/sts" ucp_aws "github.com/radius-project/radius/pkg/ucp/aws" "github.com/stretchr/testify/require" apiextv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" @@ -188,12 +185,12 @@ func NewRPTestOptions(t *testing.T) RPTestOptions { cfg, err := awsconfig.LoadDefaultConfig(ctx) require.NoError(t, err) - //var awsClient ucp_aws.AWSCloudControlClient = cloudcontrol.NewFromConfig(cfg) + /*var awsClient ucp_aws.AWSCloudControlClient = cloudcontrol.NewFromConfig(cfg) stsClient := sts.NewFromConfig(cfg) roleARN := "arn:aws:iam::179022619019:role/radius_func_test" creds := stscreds.NewAssumeRoleProvider(stsClient, roleARN) - cfg.Credentials = aws.NewCredentialsCache(creds) + cfg.Credentials = aws.NewCredentialsCache(creds)*/ var awsClient ucp_aws.AWSCloudControlClient = cloudcontrol.NewFromConfig(cfg) return RPTestOptions{