diff --git a/internal/cmd/server.go b/internal/cmd/server.go index cc309e140a2..3361c9acfbb 100644 --- a/internal/cmd/server.go +++ b/internal/cmd/server.go @@ -155,11 +155,7 @@ func setupRunners(cfg *config.Server) error { // Wait until done <-ctx.Done() // Close messages - pResources.GatewayAPIResources.Close() - pResources.GatewayStatuses.Close() - pResources.HTTPRouteStatuses.Close() - pResources.TLSRouteStatuses.Close() - pResources.UDPRouteStatuses.Close() + pResources.Close() xdsIR.Close() infraIR.Close() xds.Close() diff --git a/internal/message/types.go b/internal/message/types.go index 70aad839d95..2a272b6b55f 100644 --- a/internal/message/types.go +++ b/internal/message/types.go @@ -48,6 +48,14 @@ func (p *ProviderResources) GetResourcesKey() string { return "" } +func (p *ProviderResources) Close() { + p.GatewayAPIResources.Close() + p.GatewayStatuses.Close() + p.HTTPRouteStatuses.Close() + p.TLSRouteStatuses.Close() + p.UDPRouteStatuses.Close() +} + // XdsIR message type XdsIR struct { watchable.Map[string, *ir.Xds]