Use s.roles instead of defaultRoles in describeSecurityGroupOverridesByID
defaultRoles only makes sense for AWSClusters but not for
AWSManagedControlPlane, as both have a different set of SGs that can be
overridden.
This fixes ignoring of node-eks-additional (see which is not part
of defaultRoles.
@@ -219,7 +219,7 @@ func (s *Service) describeSecurityGroupOverridesByID() (map[infrav1.SecurityGrou
}
if len(overrides) > 0 {
- for _, role := range defaultRoles {
+ for _, role := range s.roles {
securityGroupID, ok := s.scope.SecurityGroupOverrides()[role]
if ok {
securityGroupIds[role] = aws.String(securityGroupID)
@@ -234,7 +234,7 @@ func (s *Service) describeSecurityGroupOverridesByID() (map[infrav1.SecurityGrou
}
res := make(map[infrav1.SecurityGroupRole]*ec2.SecurityGroup, len(out.SecurityGroups))
- for _, role := range defaultRoles {
+ for _, role := range s.roles {
for _, ec2sg := range out.SecurityGroups {
if securityGroupIds[role] == nil {
continue
