Skip to content

Commit f3e86d2

Browse files
committed
Fix CCM Bug in Sec List Rule Management when ipPReserveSource is set to true for NLBs
1 parent d25a152 commit f3e86d2

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

pkg/cloudprovider/providers/oci/load_balancer.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1242,6 +1242,7 @@ func (clb *CloudLoadBalancerProvider) updateBackendSet(ctx context.Context, lbID
12421242
// For NLB, due to source IP preservation we need to ensure ingress rules from sourceCIDRs are added to
12431243
// the backends subnet's seclist as well
12441244
sc.actualPorts = action.OldPorts
1245+
sc.sourceCIDRs = spec.SourceCIDRs
12451246
if err = secListManager.Update(ctx, sc); err != nil {
12461247
return err
12471248
}

pkg/cloudprovider/providers/oci/load_balancer_security_lists_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -741,12 +741,13 @@ func TestGetNodeIngressRules_NLB(t *testing.T) {
741741
HealthCheckerPort: k8sports.ProxyHealthzPort + 1,
742742
},
743743
services: []*v1.Service{},
744-
isPreserveSource: false,
744+
isPreserveSource: true,
745745
sourceCIDRs: []string{"0.0.0.0/0"},
746746
expected: []core.IngressSecurityRule{
747747
core.IngressSecurityRule{Source: common.String("0.0.0.0/0")},
748748
makeIngressSecurityRule("10.0.50.0/24", 8081),
749749
makeIngressSecurityRule("10.0.51.0/24", 8081),
750+
makeIngressSecurityRule("0.0.0.0/0", 8081),
750751
makeIngressSecurityRule("10.0.50.0/24", k8sports.ProxyHealthzPort+1),
751752
makeIngressSecurityRule("10.0.51.0/24", k8sports.ProxyHealthzPort+1),
752753
},

0 commit comments

Comments
 (0)