Skip to content

Commit 8533ef5

Browse files
authored
Make sure that additional ports security groups are dynamic and cannot go out of range
1 parent 645741c commit 8533ef5

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

pkg/cloud/services/networking/securitygroups_rules.go

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -223,11 +223,9 @@ func getSGControlPlaneAdditionalPorts(ports []int) []resolvedSecurityGroupRuleSp
223223
Protocol: "tcp",
224224
},
225225
}
226-
for _, p := range ports {
227-
r[0].PortRangeMin = p
228-
r[0].PortRangeMax = p
229-
r[1].PortRangeMin = p
230-
r[1].PortRangeMax = p
226+
for i, p := range ports {
227+
r[i].PortRangeMin = p
228+
r[i].PortRangeMax = p
231229
controlPlaneRules = append(controlPlaneRules, r...)
232230
}
233231
return controlPlaneRules

0 commit comments

Comments
 (0)