Skip to content

Commit

Permalink
Merge pull request #191 from reasonerjt/irsa-additional-bsl
Browse files Browse the repository at this point in the history
Unset env vars for role-assumption when creds are set
  • Loading branch information
ywk253100 authored Feb 1, 2024
2 parents 682678f + f5f2e80 commit 581fc82
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions velero-plugin-for-aws/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ func newAWSConfig(region, profile, credentialsFile string, insecureSkipTLSVerify
// To support the existing use case where config file is passed
// as credentials of a BSL
config.WithSharedConfigFiles([]string{credentialsFile}))
// unset the env variables to bypass the role assumption when IRSA is configured
os.Setenv("AWS_WEB_IDENTITY_TOKEN_FILE", "")
os.Setenv("AWS_ROLE_SESSION_NAME", "")
os.Setenv("AWS_ROLE_ARN", "")
}

awsConfig, err := config.LoadDefaultConfig(context.Background(), opts...)
Expand Down

0 comments on commit 581fc82

Please sign in to comment.