Skip to content

Commit

Permalink
Fix AWS credential retrieval
Browse files Browse the repository at this point in the history
  • Loading branch information
Mirel Ferchezau committed Aug 8, 2017
1 parent b946a6f commit 0576dd5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions runtime.go
Original file line number Diff line number Diff line change
Expand Up @@ -328,8 +328,8 @@ func getSessionOrDefaultCreds() map[string]string {
}

// Obtain AWS credentials and pass them through to the container runtime via env variables
if sess, err := session.NewSession(); err != nil {
if creds, err := sess.Config.Credentials.Get(); err != nil {
if sess, err := session.NewSession(); err == nil {
if creds, err := sess.Config.Credentials.Get(); err == nil {
result["region"] = *sess.Config.Region
result["key"] = creds.AccessKeyID
result["secret"] = creds.SecretAccessKey
Expand Down

0 comments on commit 0576dd5

Please sign in to comment.