only warn when getting interface list fails (#5272)

Signed-off-by: Chris O'Haver <cohaver@infoblox.com>
This commit is contained in:
Chris O'Haver 2022-03-18 10:11:53 -04:00 committed by GitHub
parent 74b84a1377
commit 90680b7077
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -8,6 +8,7 @@ import (
"github.com/coredns/caddy"
"github.com/coredns/coredns/core/dnsserver"
"github.com/coredns/coredns/plugin"
"github.com/coredns/coredns/plugin/pkg/log"
)
func setup(c *caddy.Controller) error {
@ -17,7 +18,7 @@ func setup(c *caddy.Controller) error {
all := []string{}
ifaces, err := net.Interfaces()
if err != nil {
return plugin.Error("bind", fmt.Errorf("failed to get interfaces list: %s", err))
log.Warning(plugin.Error("bind", fmt.Errorf("failed to get interfaces list, cannot bind by interface name: %s", err)))
}
for c.Next() {