From ef33dc62c65d93e710118534a6dfbbc293db78a1 Mon Sep 17 00:00:00 2001 From: Yuan-Hsiang Lee <44178603+yhlee-tw@users.noreply.github.com> Date: Wed, 24 Jul 2019 18:17:00 -0600 Subject: [PATCH] fix: return creds for assumed role (#186) do not shadow outer creds fixes #182 --- lib/provider.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/provider.go b/lib/provider.go index f956cfa8..b2650d42 100644 --- a/lib/provider.go +++ b/lib/provider.go @@ -157,7 +157,8 @@ func (p *Provider) Retrieve() (credentials.Value, error) { // roles directly. if p.profile != source { if role, ok := p.profiles[p.profile]["role_arn"]; ok { - creds, err := p.assumeRoleFromSession(creds, role) + var err error + creds, err = p.assumeRoleFromSession(creds, role) if err != nil { return credentials.Value{}, err }