Skip to content

Commit c0fc7c6

Browse files
ivanmatmatiGopher Bot
authored andcommitted
BUG/MEDIUM: fix previousMapPort2Listeners never populated in resetListenerConflicts
resetListenerConflicts was resetting both mapPort2Listeners and previousMapPort2Listeners to empty maps. As a result, previousGatewaysWithPortConflicts() always returned an empty set, making checkListenerConflicts unable to detect Gateways whose conflicts had been resolved since the previous reconciliation cycle. When a conflicting Gateway was deleted, the surviving Gateway would not be added to the update list for reprocessing and would retain its conflict condition in Kubernetes status indefinitely. Fix by saving the current mapPort2Listeners into previousMapPort2Listeners before resetting the current map, so that the previous conflict state is correctly preserved across reconciliation cycles.
1 parent 8cffc77 commit c0fc7c6

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

k8s/gate/tree/gateway_builder.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,8 +196,8 @@ func (b *GatewayBuilderImpl) buildListeners(treeGw *Gateway) {
196196
}
197197

198198
func (b *GatewayBuilderImpl) resetListenerConflicts() {
199+
b.ControllerStore.previousMapPort2Listeners = b.ControllerStore.mapPort2Listeners
199200
b.ControllerStore.mapPort2Listeners = make(map[gatewayv1.PortNumber]listenerConflict)
200-
b.ControllerStore.previousMapPort2Listeners = make(map[gatewayv1.PortNumber]listenerConflict)
201201
}
202202

203203
// checkListenerConflicts checks the conflicts between all Gateway listeners

0 commit comments

Comments
 (0)