mirror of https://github.com/kubernetes/kops.git
Don't skip roles that don't have cluster name prefix
This should plug the IAM roles leak. It probably a leftover from when roles did not have tags and we relied on the name of the role instead.
This commit is contained in:
parent
8e7a50346b
commit
09b604867d
|
|
@ -1998,9 +1998,6 @@ func ListIAMRoles(cloud fi.Cloud, clusterName string) ([]*resources.Resource, er
|
|||
err := c.IAM().ListRolesPages(request, func(p *iam.ListRolesOutput, lastPage bool) bool {
|
||||
for _, r := range p.Roles {
|
||||
name := aws.StringValue(r.RoleName)
|
||||
if !strings.HasSuffix(name, "."+clusterName) {
|
||||
continue
|
||||
}
|
||||
|
||||
getRequest := &iam.GetRoleInput{RoleName: r.RoleName}
|
||||
roleOutput, err := c.IAM().GetRole(getRequest)
|
||||
|
|
|
|||
Loading…
Reference in New Issue