From 5440fe6256763f87a932fe4b33a5c1a582bf48ae Mon Sep 17 00:00:00 2001 From: Abhinav Pandey Date: Thu, 12 Oct 2023 10:45:49 -0700 Subject: [PATCH] Fix Cloudstack Etcd encryption test (#6807) --- internal/test/e2e/etcdEncryption.go | 2 +- test/framework/etcdencryption.go | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/internal/test/e2e/etcdEncryption.go b/internal/test/e2e/etcdEncryption.go index 79160e20c93d..05b0f2a235ff 100644 --- a/internal/test/e2e/etcdEncryption.go +++ b/internal/test/e2e/etcdEncryption.go @@ -36,7 +36,7 @@ func (e *E2ESession) setupEtcdEncryption(testRegex string) error { return fmt.Errorf("decoding ssh key: %v", err) } - command := fmt.Sprintf("sudo cat <> /%s\n%s\nEOF", e2etests.SSHKeyPath, string(decodedKey)) + command := fmt.Sprintf("sudo cat <> %s\n%s\nEOF", e2etests.SSHKeyPath, string(decodedKey)) if err := ssm.Run(e.session, logr.Discard(), e.instanceId, command, ssmTimeout); err != nil { return fmt.Errorf("mounting ssh key in instance: %v", err) } diff --git a/test/framework/etcdencryption.go b/test/framework/etcdencryption.go index 376f7b978022..eb893b7e2060 100644 --- a/test/framework/etcdencryption.go +++ b/test/framework/etcdencryption.go @@ -14,6 +14,7 @@ import ( "os" "strings" + "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/session" jose "github.com/go-jose/go-jose/v3" v1 "k8s.io/api/core/v1" @@ -164,7 +165,9 @@ func (e *ClusterE2ETest) ValidateEtcdEncryption() { func (e *ClusterE2ETest) PostClusterCreateEtcdEncryptionSetup() { ctx := context.Background() envVars := getEtcdEncryptionVarsFromEnv() - awsSession, err := session.NewSession() + awsSession, err := session.NewSession(&aws.Config{ + Region: aws.String(defaultRegion), + }) if err != nil { e.T.Fatalf("creating aws session for tests: %v", err) }