Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
njuettner committed Nov 8, 2023
1 parent 2677d00 commit f613385
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 14 deletions.
8 changes: 4 additions & 4 deletions controllers/common_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -562,6 +562,7 @@ var clusterAutoscalerRoleInfo = RoleInfo{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"autoscaling:DescribeAutoScalingGroups",
"autoscaling:DescribeAutoScalingInstances",
Expand All @@ -571,19 +572,18 @@ var clusterAutoscalerRoleInfo = RoleInfo{
"ec2:DescribeInstanceTypes",
"ec2:DescribeLaunchTemplateVersions",
],
"Resource": "*",
"Effect": "Allow"
"Resource": "*"
},
{
"Effect": "Allow",
"Action": [
"autoscaling:SetDesiredCapacity",
"autoscaling:TerminateInstanceInAutoScalingGroup",
"ec2:DescribeImages",
"ec2:GetInstanceTypesFromInstanceRequirements",
"eks:DescribeNodegroup"
],
"Resource": "*",
"Effect": "Allow"
"Resource": "*"
}
]
}`,
Expand Down
8 changes: 4 additions & 4 deletions pkg/iam/cluster_autoscaler_template.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ const clusterAutoscalerPolicyTemplate = `{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"autoscaling:DescribeAutoScalingGroups",
"autoscaling:DescribeAutoScalingInstances",
Expand All @@ -13,19 +14,18 @@ const clusterAutoscalerPolicyTemplate = `{
"ec2:DescribeInstanceTypes",
"ec2:DescribeLaunchTemplateVersions",
],
"Resource": "*",
"Effect": "Allow"
"Resource": "*"
},
{
"Effect": "Allow",
"Action": [
"autoscaling:SetDesiredCapacity",
"autoscaling:TerminateInstanceInAutoScalingGroup",
"ec2:DescribeImages",
"ec2:GetInstanceTypesFromInstanceRequirements",
"eks:DescribeNodegroup"
],
"Resource": "*",
"Effect": "Allow"
"Resource": "*"
}
]
}`
6 changes: 0 additions & 6 deletions pkg/iam/iam.go
Original file line number Diff line number Diff line change
Expand Up @@ -458,12 +458,6 @@ func (s *IAMService) DeleteRolesForIRSA() error {
return err
}

// delete cluster-autoscaler role
err = s.deleteRole(roleName(ClusterAutoscalerRole, s.clusterName))
if err != nil {
return err
}

s.log.Info("finished deleting IAM roles for IRSA")
return nil
}
Expand Down

0 comments on commit f613385

Please sign in to comment.