Fix reloading in health and ready (#3473)

Signed-off-by: zouyee <zounengren@cmss.chinamobile.com>
This commit is contained in:
Zou Nengren
2019-11-20 20:14:37 +08:00
committed by Miek Gieben
parent 65cae54ddf
commit 768ca99c57
2 changed files with 4 additions and 3 deletions

View File

@@ -8,6 +8,7 @@ import (
"time"
clog "github.com/coredns/coredns/plugin/pkg/log"
"github.com/coredns/coredns/plugin/pkg/reuseport"
)
var log = clog.NewWithPlugin("health")
@@ -29,8 +30,7 @@ func (h *health) OnStartup() error {
h.Addr = ":8080"
}
h.stop = make(chan bool)
ln, err := net.Listen("tcp", h.Addr)
ln, err := reuseport.Listen("tcp", h.Addr)
if err != nil {
return err
}

View File

@@ -12,6 +12,7 @@ import (
clog "github.com/coredns/coredns/plugin/pkg/log"
"github.com/coredns/coredns/plugin/pkg/uniq"
"github.com/coredns/coredns/plugin/pkg/reuseport"
)
var (
@@ -30,7 +31,7 @@ type ready struct {
}
func (rd *ready) onStartup() error {
ln, err := net.Listen("tcp", rd.Addr)
ln, err := reuseport.Listen("tcp", rd.Addr)
if err != nil {
return err
}