Apply suggestions from code review

Co-Authored-By: Lauris BH <lauris@nix.lv>
This commit is contained in:
Joe Walton 2019-10-14 10:20:32 +01:00 committed by GitHub
parent b5b34938c5
commit 2184682042
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -44,7 +44,6 @@ func main() {
} }
sess, err := session.NewSession(&aws.Config{Region: &region}) sess, err := session.NewSession(&aws.Config{Region: &region})
if err != nil { if err != nil {
log.Fatal(fmt.Sprintf("error creating aws session: %v", err)) log.Fatal(fmt.Sprintf("error creating aws session: %v", err))
} }
@ -185,6 +184,7 @@ func getECRClient(sess *session.Session, role string) *ecr.ECR {
if role == "" { if role == "" {
return ecr.New(sess) return ecr.New(sess)
} }
creds := stscreds.NewCredentials(sess, role) return ecr.New(sess, &aws.Config{
return ecr.New(sess, &aws.Config{Credentials: creds}) Credentials: stscreds.NewCredentials(sess, role),
})
} }