Skip to content

Commit 3fed355

Browse files
committed
only sync relevant BackendSets and Listeners for an Ingress reconciliation
1 parent 54e2d36 commit 3fed355

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

pkg/controllers/ingress/ingress.go

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -398,9 +398,11 @@ func (c *Controller) ensureIngress(ctx context.Context, ingress *networkingv1.In
398398
for bsName := range lb.BackendSets {
399399
actualBackendSets.Insert(bsName)
400400

401-
err = syncBackendSet(ctx, ingress, lbId, bsName, stateStore, certificateCompartmentId, c)
402-
if err != nil {
403-
return err
401+
if desiredBackendSets.Has(bsName) {
402+
err = syncBackendSet(ctx, ingress, lbId, bsName, stateStore, certificateCompartmentId, c)
403+
if err != nil {
404+
return err
405+
}
404406
}
405407
}
406408

@@ -430,11 +432,14 @@ func (c *Controller) ensureIngress(ctx context.Context, ingress *networkingv1.In
430432
// Determine listeners... This is based off path ports.
431433
actualListenerPorts := sets.NewInt32()
432434
for _, listener := range lb.Listeners {
433-
actualListenerPorts.Insert(int32(*listener.Port))
435+
listenerPort := int32(*listener.Port)
436+
actualListenerPorts.Insert(listenerPort)
434437

435-
err := syncListener(ctx, ingress.Namespace, stateStore, &lbId, *listener.Name, certificateCompartmentId, c)
436-
if err != nil {
437-
return err
438+
if desiredPorts.Has(listenerPort) {
439+
err := syncListener(ctx, ingress.Namespace, stateStore, &lbId, *listener.Name, certificateCompartmentId, c)
440+
if err != nil {
441+
return err
442+
}
438443
}
439444
}
440445

0 commit comments

Comments
 (0)