AWS_DEFAULT_REGION should have been checked as a backup to AWS_REGION, but wasn't. Also removed a redundant print statement in a test case.

Change-Id: I0de4bcd5a134f7a9af249e5ebe56dfc3d35abf6d
This commit is contained in:
Patrick Jones
2021-03-17 15:44:40 -07:00
parent 9bb904979d
commit 57bbf4f324
2 changed files with 2 additions and 2 deletions

View File

@@ -341,6 +341,8 @@ func (cs awsCredentialSource) subjectToken() (string, error) {
func (cs *awsCredentialSource) getRegion() (string, error) {
if envAwsRegion := getenv("AWS_REGION"); envAwsRegion != "" {
return envAwsRegion, nil
} else if envAwsRegion := getenv("AWS_DEFAULT_REGION"); envAwsRegion != "" {
return envAwsRegion, nil
}
if cs.RegionURL == "" {