Skip to content

Commit

Permalink
egressgw: policy: stop iterating through nodes after first match
Browse files Browse the repository at this point in the history
in regenerateGatewayConfig(), once a node that matches the given policy
is found, there's no need to keep iterating through the rest of the
nodes, so let's just return to the caller

Suggested-by: Julian Wiedmann <jwi@isovalent.com>
Signed-off-by: Gilberto Bertin <jibi@cilium.io>
  • Loading branch information
jibi authored and pchaigno committed Apr 16, 2023
1 parent 220b297 commit edbd28b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pkg/egressgateway/policy.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,8 @@ func (config *PolicyConfig) regenerateGatewayConfig(manager *Manager) {
logger.WithError(err).Error("Failed to derive policy gateway configuration")
}
}

break
}

config.gatewayConfig = gwc
Expand Down

0 comments on commit edbd28b

Please sign in to comment.