From 2171cb7f3dd30968f2750654b96a86360981e78a Mon Sep 17 00:00:00 2001 From: Nicholas Wiersma Date: Thu, 16 Apr 2020 16:18:04 +0200 Subject: [PATCH] fix: consider UDP when checking for empty config --- pkg/server/configurationwatcher.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkg/server/configurationwatcher.go b/pkg/server/configurationwatcher.go index 8bca826cf..3434e727a 100644 --- a/pkg/server/configurationwatcher.go +++ b/pkg/server/configurationwatcher.go @@ -241,10 +241,14 @@ func isEmptyConfiguration(conf *dynamic.Configuration) bool { if conf.HTTP == nil { conf.HTTP = &dynamic.HTTPConfiguration{} } + if conf.UDP == nil { + conf.UDP = &dynamic.UDPConfiguration{} + } httpEmpty := conf.HTTP.Routers == nil && conf.HTTP.Services == nil && conf.HTTP.Middlewares == nil tlsEmpty := conf.TLS == nil || conf.TLS.Certificates == nil && conf.TLS.Stores == nil && conf.TLS.Options == nil tcpEmpty := conf.TCP.Routers == nil && conf.TCP.Services == nil + udpEmpty := conf.UDP.Routers == nil && conf.UDP.Services == nil - return httpEmpty && tlsEmpty && tcpEmpty + return httpEmpty && tlsEmpty && tcpEmpty && udpEmpty }