fix: consider UDP when checking for empty config

This commit is contained in:
Nicholas Wiersma 2020-04-16 16:18:04 +02:00 committed by GitHub
parent f55a09862e
commit 2171cb7f3d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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
}