@@ -80,8 +80,8 @@ func (s *securityListManagerImpl) Delete(
80
80
lbSubnets []* baremetal.Subnet ,
81
81
backendSubnets []* baremetal.Subnet ,
82
82
listenerPort uint64 ,
83
- backendPort uint64 ) error {
84
-
83
+ backendPort uint64 ,
84
+ ) error {
85
85
noSubnets := []* baremetal.Subnet {}
86
86
noSourceCIDRs := []string {}
87
87
@@ -209,7 +209,7 @@ func getNodeIngressRules(securityList *baremetal.SecurityList, lbSubnets []*bare
209
209
ingressRules := []baremetal.IngressSecurityRule {}
210
210
211
211
for _ , rule := range securityList .IngressSecurityRules {
212
- if rule .TCPOptions == nil ||
212
+ if rule .TCPOptions == nil || rule . TCPOptions . SourcePortRange != nil || rule . TCPOptions . DestinationPortRange == nil ||
213
213
(rule .TCPOptions .DestinationPortRange .Min != port &&
214
214
rule .TCPOptions .DestinationPortRange .Max != port ) {
215
215
// this rule doesn't apply to this service so nothing to do but keep it
@@ -246,8 +246,7 @@ func getLoadBalancerIngressRules(lbSecurityList *baremetal.SecurityList, sourceC
246
246
247
247
ingressRules := []baremetal.IngressSecurityRule {}
248
248
for _ , rule := range lbSecurityList .IngressSecurityRules {
249
-
250
- if rule .TCPOptions == nil ||
249
+ if rule .TCPOptions == nil || rule .TCPOptions .SourcePortRange != nil || rule .TCPOptions .DestinationPortRange == nil ||
251
250
(rule .TCPOptions .DestinationPortRange .Min != port &&
252
251
rule .TCPOptions .DestinationPortRange .Max != port ) {
253
252
// this rule doesn't apply to this service so nothing to do but keep it
@@ -287,7 +286,7 @@ func getLoadBalancerEgressRules(lbSecurityList *baremetal.SecurityList, nodeSubn
287
286
288
287
egressRules := []baremetal.EgressSecurityRule {}
289
288
for _ , rule := range lbSecurityList .EgressSecurityRules {
290
- if rule .TCPOptions == nil ||
289
+ if rule .TCPOptions == nil || rule . TCPOptions . SourcePortRange != nil || rule . TCPOptions . DestinationPortRange == nil ||
291
290
(rule .TCPOptions .DestinationPortRange .Min != port &&
292
291
rule .TCPOptions .DestinationPortRange .Max != port ) {
293
292
// this rule doesn't apply to this service so nothing to do but keep it
@@ -325,7 +324,7 @@ func makeEgressSecurityRule(cidrBlock string, port uint64) baremetal.EgressSecur
325
324
Destination : cidrBlock ,
326
325
Protocol : fmt .Sprintf ("%d" , ProtocolTCP ),
327
326
TCPOptions : & baremetal.TCPOptions {
328
- DestinationPortRange : baremetal.PortRange {
327
+ DestinationPortRange : & baremetal.PortRange {
329
328
Min : port ,
330
329
Max : port ,
331
330
},
@@ -340,7 +339,7 @@ func makeIngressSecurityRule(cidrBlock string, port uint64) baremetal.IngressSec
340
339
Source : cidrBlock ,
341
340
Protocol : fmt .Sprintf ("%d" , ProtocolTCP ),
342
341
TCPOptions : & baremetal.TCPOptions {
343
- DestinationPortRange : baremetal.PortRange {
342
+ DestinationPortRange : & baremetal.PortRange {
344
343
Min : port ,
345
344
Max : port ,
346
345
},
@@ -352,8 +351,7 @@ func makeIngressSecurityRule(cidrBlock string, port uint64) baremetal.IngressSec
352
351
// securityListManagerNOOP implements the securityListManager interface but does
353
352
// no logic, so that it can be used to not handle security lists if the user doesn't wish
354
353
// to use that feature.
355
- type securityListManagerNOOP struct {
356
- }
354
+ type securityListManagerNOOP struct {}
357
355
358
356
func (s * securityListManagerNOOP ) Update (lbSubnets []* baremetal.Subnet , backendSubnets []* baremetal.Subnet , sourceCIDRs []string , listenerPort uint64 , backendPort uint64 ) error {
359
357
return nil
0 commit comments