mirror of
https://github.com/optim-enterprises-bv/vault.git
synced 2025-11-01 19:17:58 +00:00
Fix AWS region tests (#8145)
* fix aws region tests * strip logger * return an error, restore tests to master * fix extra line at import * revert changes in spacing and comments * Update sdk/helper/awsutil/region.go Co-Authored-By: Jim Kalafut <jkalafut@hashicorp.com> * strip explicit nil value Co-authored-by: Jim Kalafut <jim@kalafut.net>
This commit is contained in:
@@ -13,6 +13,7 @@ import (
|
||||
"github.com/aws/aws-sdk-go/aws/session"
|
||||
"github.com/aws/aws-sdk-go/service/sts"
|
||||
"github.com/hashicorp/errwrap"
|
||||
"github.com/hashicorp/go-hclog"
|
||||
"github.com/hashicorp/vault/api"
|
||||
"github.com/hashicorp/vault/sdk/helper/awsutil"
|
||||
)
|
||||
@@ -40,7 +41,8 @@ func GenerateLoginData(creds *credentials.Credentials, headerValue, configuredRe
|
||||
// Use the credentials we've found to construct an STS session
|
||||
region, err := awsutil.GetRegion(configuredRegion)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
hclog.Default().Warn(fmt.Sprintf("defaulting region to %q due to %s", awsutil.DefaultRegion, err.Error()))
|
||||
region = awsutil.DefaultRegion
|
||||
}
|
||||
stsSession, err := session.NewSessionWithOptions(session.Options{
|
||||
Config: aws.Config{
|
||||
|
||||
Reference in New Issue
Block a user