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
Signed by: GitHub
GPG Key ID: 4AEE18F83AFDEB23

@ -44,7 +44,6 @@ func main() {
}
sess, err := session.NewSession(&aws.Config{Region: &region})
if err != nil {
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 == "" {
return ecr.New(sess)
}
creds := stscreds.NewCredentials(sess, role)
return ecr.New(sess, &aws.Config{Credentials: creds})
return ecr.New(sess, &aws.Config{
Credentials: stscreds.NewCredentials(sess, role),
})
}