Skip to content

Commit

Permalink
Correctly set Role and RoleArn in RefreshableProvider (#55)
Browse files Browse the repository at this point in the history
  • Loading branch information
patricksanders authored Mar 25, 2021
1 parent 6d96eb2 commit 1d4fb4b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion creds/refreshable.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ package creds

import (
"fmt"
"strings"
"time"

"github.com/spf13/viper"
Expand All @@ -30,8 +31,11 @@ import (
// NewRefreshableProvider creates an AWS credential provider that will automatically refresh credentials
// when they are close to expiring
func NewRefreshableProvider(client HTTPClient, role, region string, assumeChain []string, noIpRestrict bool) (*RefreshableProvider, error) {
splitRole := strings.Split(role, "/")
roleName := splitRole[len(splitRole)-1]
rp := &RefreshableProvider{
Role: role,
Role: roleName,
RoleArn: role,
Region: region,
NoIpRestrict: noIpRestrict,
AssumeChain: assumeChain,
Expand Down

0 comments on commit 1d4fb4b

Please sign in to comment.