From e5f5aec537b1adda310bd291a1d729c82a8bab7f Mon Sep 17 00:00:00 2001 From: Vinayak Goyal Date: Thu, 22 Oct 2020 15:55:57 -0700 Subject: [PATCH] Add klog.InitFlags to correctly handle klog flags. --- cmd/gke-exec-auth-plugin/main.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cmd/gke-exec-auth-plugin/main.go b/cmd/gke-exec-auth-plugin/main.go index 01b92de4f7..a4f973a959 100644 --- a/cmd/gke-exec-auth-plugin/main.go +++ b/cmd/gke-exec-auth-plugin/main.go @@ -44,12 +44,12 @@ func init() { metav1.AddToGroupVersion(scheme, schema.GroupVersion{Version: "v1"}) clientauthv1alpha1.AddToScheme(scheme) clientauthentication.AddToScheme(scheme) - - // Override the default in klog. There's verbosity flag for suppressing output. - flag.Set("logtostderr", "true") } func main() { + klog.InitFlags(nil) + defer klog.Flush() + flag.Set("logtostderr", "true") flag.Parse() var key, cert []byte