diff options
author | 2019-08-01 12:51:37 +0000 | |
---|---|---|
committer | 2019-08-01 05:51:37 -0700 | |
commit | a01b202b6ace52148dcfdfe8bc723878e0f911f8 (patch) | |
tree | c885cccb1756301238543eeb1bfd046db2d2902a /plugin/kubernetes/setup.go | |
parent | 3219a2b93a8010af9b5c2263c658815a4494416e (diff) | |
download | coredns-a01b202b6ace52148dcfdfe8bc723878e0f911f8.tar.gz coredns-a01b202b6ace52148dcfdfe8bc723878e0f911f8.tar.zst coredns-a01b202b6ace52148dcfdfe8bc723878e0f911f8.zip |
Fixes races in test and klog (#3079)
Various fixes to make things less flaky:
* kubernetes: put klog.SetOutput in the setup function, not in the init
function to see if that helps
* file: make z.Expired a boolean instead of a pointer to a boolean
* test: fix TestSecondaryZoneTransfer test, which wasn't actually
testing in the right way. It's more right now, but may still be racy
(race introduced because a file's lazy loading of zones)
Signed-off-by: Miek Gieben <miek@miek.nl>
Diffstat (limited to 'plugin/kubernetes/setup.go')
-rw-r--r-- | plugin/kubernetes/setup.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/plugin/kubernetes/setup.go b/plugin/kubernetes/setup.go index 1b0f20769..00c698181 100644 --- a/plugin/kubernetes/setup.go +++ b/plugin/kubernetes/setup.go @@ -19,7 +19,7 @@ import ( "github.com/miekg/dns" meta "k8s.io/apimachinery/pkg/apis/meta/v1" - // Pull this in for logtostderr flag parsing + // Pull this in setting klog's output to stdout "k8s.io/klog" // Excluding azure because it is failing to compile @@ -35,8 +35,6 @@ import ( var log = clog.NewWithPlugin("kubernetes") func init() { - klog.SetOutput(os.Stdout) - caddy.RegisterPlugin("kubernetes", caddy.Plugin{ ServerType: "dns", Action: setup, @@ -44,6 +42,8 @@ func init() { } func setup(c *caddy.Controller) error { + klog.SetOutput(os.Stdout) + k, err := kubernetesParse(c) if err != nil { return plugin.Error("kubernetes", err) |