Skip to content

Commit

Permalink
fix: consider UDP when checking for empty config
Browse files Browse the repository at this point in the history
  • Loading branch information
nrwiersma committed Apr 16, 2020
1 parent f55a098 commit 2171cb7
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pkg/server/configurationwatcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

0 comments on commit 2171cb7

Please sign in to comment.