diff --git a/pkg/cloud/services/networking/securitygroups_rules.go b/pkg/cloud/services/networking/securitygroups_rules.go index e7dcdd1d3b..5bea83c1a4 100644 --- a/pkg/cloud/services/networking/securitygroups_rules.go +++ b/pkg/cloud/services/networking/securitygroups_rules.go @@ -223,11 +223,9 @@ func getSGControlPlaneAdditionalPorts(ports []int) []resolvedSecurityGroupRuleSp Protocol: "tcp", }, } - for _, p := range ports { - r[0].PortRangeMin = p - r[0].PortRangeMax = p - r[1].PortRangeMin = p - r[1].PortRangeMax = p + for i, p := range ports { + r[i].PortRangeMin = p + r[i].PortRangeMax = p controlPlaneRules = append(controlPlaneRules, r...) } return controlPlaneRules