plugin/kubernetes: fix reload panic (#4881)

* fix reload panic

Signed-off-by: Chris O'Haver <cohaver@infoblox.com>

* add comment

Signed-off-by: Chris O'Haver <cohaver@infoblox.com>

* o import ordering

Signed-off-by: Chris O'Haver <cohaver@infoblox.com>
This commit is contained in:
Chris O'Haver 2021-09-22 10:28:51 -04:00 committed by GitHub
parent 8ddb6313bb
commit e742b5ee34
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -31,7 +31,7 @@ var log = clog.NewWithPlugin(pluginName)
func init() { plugin.Register(pluginName, setup) }
func setup(c *caddy.Controller) error {
klog.InitFlags(nil)
// Do not call klog.InitFlags(nil) here. It will cause reload to panic.
klog.SetOutput(os.Stdout)
k, err := kubernetesParse(c)