Skip to content

Commit

Permalink
Merge pull request #469 from openshift-cherrypick-robot/cherry-pick-4…
Browse files Browse the repository at this point in the history
…68-to-release-4.12

[release-4.12] OCPBUGS-15548: Pass right SGs for IsExternallyManaged on creation
  • Loading branch information
openshift-merge-robot committed Jul 5, 2023
2 parents 15ff2ac + dd1b81f commit e3a8e43
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion pkg/cloud/services/ec2/instances.go
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,14 @@ func (s *Service) getFilteredSubnets(criteria ...*ec2.Filter) ([]*ec2.Subnet, er
// They are considered "core" to its proper functioning.
func (s *Service) GetCoreSecurityGroups(scope *scope.MachineScope) ([]string, error) {
if scope.IsExternallyManaged() {
return nil, nil
ids := make([]string, 0)
for _, sg := range scope.AWSMachine.Spec.AdditionalSecurityGroups {
if sg.ID == nil {
continue
}
ids = append(ids, *sg.ID)
}
return ids, nil
}

// These are common across both controlplane and node machines
Expand Down

0 comments on commit e3a8e43

Please sign in to comment.