diff options
author | 2022-06-26 23:49:45 +0200 | |
---|---|---|
committer | 2022-06-26 14:49:45 -0700 | |
commit | e0dead4aa27cada3e292d45bd65b849ca1e63255 (patch) | |
tree | 1745830c1144b5c69a02140381bea9f453d9f356 /plugin/kubernetes/setup.go | |
parent | 4a40e9e3a0dfe40da319f5d8e724120ed796da8e (diff) | |
download | coredns-e0dead4aa27cada3e292d45bd65b849ca1e63255.tar.gz coredns-e0dead4aa27cada3e292d45bd65b849ca1e63255.tar.zst coredns-e0dead4aa27cada3e292d45bd65b849ca1e63255.zip |
plugin/kubernetes : make kubernetes client log in CoreDNS format (#5461)
Signed-off-by: Ondřej Benkovský <ondrej.benkovsky@jamf.com>
Diffstat (limited to 'plugin/kubernetes/setup.go')
-rw-r--r-- | plugin/kubernetes/setup.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/plugin/kubernetes/setup.go b/plugin/kubernetes/setup.go index 5f5ab0582..4d7bfcf03 100644 --- a/plugin/kubernetes/setup.go +++ b/plugin/kubernetes/setup.go @@ -4,7 +4,6 @@ import ( "context" "errors" "fmt" - "os" "strconv" "strings" @@ -15,6 +14,7 @@ import ( clog "github.com/coredns/coredns/plugin/pkg/log" "github.com/coredns/coredns/plugin/pkg/upstream" + "github.com/go-logr/logr" "github.com/miekg/dns" meta "k8s.io/apimachinery/pkg/apis/meta/v1" _ "k8s.io/client-go/plugin/pkg/client/auth/gcp" // pull this in here, because we want it excluded if plugin.cfg doesn't have k8s @@ -32,7 +32,7 @@ func init() { plugin.Register(pluginName, setup) } func setup(c *caddy.Controller) error { // Do not call klog.InitFlags(nil) here. It will cause reload to panic. - klog.SetOutput(os.Stdout) + klog.SetLogger(logr.New(&loggerAdapter{log})) k, err := kubernetesParse(c) if err != nil { |