Skip to content

Commit fc21748

Browse files
committed
Improve batch reload
1 parent 179ad34 commit fc21748

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

internal/k8s/controller.go

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1011,20 +1011,19 @@ func (lbc *LoadBalancerController) preSyncSecrets() {
10111011

10121012
func (lbc *LoadBalancerController) sync(task task) {
10131013
if lbc.isNginxReady && lbc.syncQueue.Len() > 1 && !lbc.batchSyncEnabled {
1014-
lbc.configurator.DisableReloads()
1015-
lbc.batchSyncEnabled = true
1016-
10171014
nl.Debugf(lbc.Logger, "Batch processing %v items", lbc.syncQueue.Len())
1015+
if task.Kind != endpointslice {
1016+
nl.Debug(lbc.Logger, "Task is not endpointslice - enabling batch reload")
1017+
lbc.configurator.DisableReloads()
1018+
lbc.batchSyncEnabled = true
1019+
lbc.enableBatchReload = true
1020+
}
10181021
}
10191022
nl.Debugf(lbc.Logger, "Syncing %v", task.Key)
10201023
if lbc.spiffeCertFetcher != nil {
10211024
lbc.syncLock.Lock()
10221025
defer lbc.syncLock.Unlock()
10231026
}
1024-
if lbc.batchSyncEnabled && task.Kind != endpointslice {
1025-
nl.Debug(lbc.Logger, "Task is not endpointslice - enabling batch reload")
1026-
lbc.enableBatchReload = true
1027-
}
10281027
switch task.Kind {
10291028
case ingress:
10301029
lbc.syncIngress(task)

0 commit comments

Comments
 (0)