fix: use defaultEntryPoints when no entryPoint is defined in a TCPRouter

This commit is contained in:
LandryBe 2021-05-11 16:46:14 +02:00 committed by GitHub
parent 40f21f41e1
commit 6ae194934d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 36 additions and 7 deletions

View file

@ -61,6 +61,12 @@ func mergeConfiguration(configurations dynamic.Configurations, defaultEntryPoint
if configuration.TCP != nil {
for routerName, router := range configuration.TCP.Routers {
if len(router.EntryPoints) == 0 {
log.WithoutContext().
WithField(log.RouterName, routerName).
Debugf("No entryPoint defined for this TCP router, using the default one(s) instead: %+v", defaultEntryPoints)
router.EntryPoints = defaultEntryPoints
}
conf.TCP.Routers[provider.MakeQualifiedName(pvd, routerName)] = router
}
for serviceName, service := range configuration.TCP.Services {