Skip to content

Commit

Permalink
make ProcessProviderOptions optional with if statement
Browse files Browse the repository at this point in the history
  • Loading branch information
atishpatel committed Jun 14, 2023
1 parent 17ee3e0 commit 7990455
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion aws/session/credentials.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,11 @@ func resolveCredsFromProfile(cfg *aws.Config,

case len(sharedCfg.CredentialProcess) != 0:
// Get credentials from CredentialProcess
creds = processcreds.NewCredentials(sharedCfg.CredentialProcess, sessOpts.CredentialsProviderOptions.ProcessProviderOptions)
var optFns []func(*processcreds.ProcessProvider)
if sessOpts.CredentialsProviderOptions != nil && sessOpts.CredentialsProviderOptions.ProcessProviderOptions != nil {
optFns = append(optFns, sessOpts.CredentialsProviderOptions.ProcessProviderOptions)
}
creds = processcreds.NewCredentials(sharedCfg.CredentialProcess, optFns...)

default:
// Fallback to default credentials provider, include mock errors for
Expand Down

0 comments on commit 7990455

Please sign in to comment.