Do not update gateway status when not selected by a gateway class

Co-authored-by: Romain <rtribotte@users.noreply.github.com>
This commit is contained in:
Kevin Pollet 2024-10-09 15:14:05 +02:00 committed by GitHub
parent 7b08ecfa5e
commit 1508a2c221
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 99 additions and 5 deletions

View file

@ -357,7 +357,13 @@ func (p *Provider) loadConfigurationFromGateways(ctx context.Context) *dynamic.C
}
}
gateways := p.client.ListGateways()
var gateways []*gatev1.Gateway
for _, gateway := range p.client.ListGateways() {
if _, ok := gatewayClassNames[string(gateway.Spec.GatewayClassName)]; !ok {
continue
}
gateways = append(gateways, gateway)
}
var gatewayListeners []gatewayListener
for _, gateway := range gateways {
@ -366,10 +372,6 @@ func (p *Provider) loadConfigurationFromGateways(ctx context.Context) *dynamic.C
Str("namespace", gateway.Namespace).
Logger()
if _, ok := gatewayClassNames[string(gateway.Spec.GatewayClassName)]; !ok {
continue
}
gatewayListeners = append(gatewayListeners, p.loadGatewayListeners(logger.WithContext(ctx), gateway, conf)...)
}