Skip to content

Commit

Permalink
Merge pull request #913 from haarchri/fix/injectedIdentity-region
Browse files Browse the repository at this point in the history
 fix multi-region with injected identity -  after v2 migration v0.20.0
  • Loading branch information
haarchri authored Nov 12, 2021
2 parents 145aa9b + 9b4b9a4 commit 2d52c4f
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions pkg/clients/aws.go
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,10 @@ func UseProviderSecret(ctx context.Context, data []byte, profile, region string)
// UsePodServiceAccount assumes an IAM role configured via a ServiceAccount.
// https://docs.aws.amazon.com/eks/latest/userguide/iam-roles-for-service-accounts.html
func UsePodServiceAccount(ctx context.Context, _ []byte, _, region string) (*aws.Config, error) {
cfg, err := config.LoadDefaultConfig(ctx)
cfg, err := config.LoadDefaultConfig(
ctx,
config.WithRegion(region),
)
if err != nil {
return nil, errors.Wrap(err, "failed to load default AWS config")
}
Expand Down Expand Up @@ -344,7 +347,10 @@ func UseProviderSecretV1(_ context.Context, data []byte, pc *v1beta1.ProviderCon
// UsePodServiceAccountV1 assumes an IAM role configured via a ServiceAccount.
// https://docs.aws.amazon.com/eks/latest/userguide/iam-roles-for-service-accounts.html
func UsePodServiceAccountV1(ctx context.Context, _ []byte, pc *v1beta1.ProviderConfig, _, region string) (*awsv1.Config, error) {
cfg, err := config.LoadDefaultConfig(ctx)
cfg, err := config.LoadDefaultConfig(
ctx,
config.WithRegion(region),
)
if err != nil {
return nil, errors.Wrap(err, "failed to load default AWS config")
}
Expand Down

0 comments on commit 2d52c4f

Please sign in to comment.