Skip to content

Commit

Permalink
fix(injected-identity): fix multioregion with injected identity since…
Browse files Browse the repository at this point in the history
… 0.20.0

Signed-off-by: haarchri <[email protected]>
  • Loading branch information
haarchri committed Nov 7, 2021
1 parent fd376a3 commit 9b4b9a4
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 @@ -259,7 +259,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 @@ -339,7 +342,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 9b4b9a4

Please sign in to comment.