Skip to content

Commit

Permalink
Change split on instance profile name (#2802)
Browse files Browse the repository at this point in the history
This now splits on the /, so we only get the last component of the instance profile name (ignoring paths)
  • Loading branch information
pwae authored and jefferai committed Jun 5, 2017
1 parent 4b1045e commit f6ba66c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion builtin/credential/aws/path_login.go
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,7 @@ func (b *backend) verifyInstanceMeetsRoleRequirements(

// Extract out the instance profile name from the instance
// profile ARN
iamInstanceProfileARNSlice := strings.SplitAfter(iamInstanceProfileARN, ":instance-profile/")
iamInstanceProfileARNSlice := strings.SplitAfter(iamInstanceProfileARN, "/")
iamInstanceProfileName := iamInstanceProfileARNSlice[len(iamInstanceProfileARNSlice)-1]

if iamInstanceProfileName == "" {
Expand Down

0 comments on commit f6ba66c

Please sign in to comment.