From 04ab5927dbafcc55f83710dfd78dff5e2589cef9 Mon Sep 17 00:00:00 2001 From: Sunil Arora Date: Fri, 30 Mar 2018 16:05:07 -0700 Subject: [PATCH] integrated glog in command structure --- cmd/kinflate/kinflate.go | 4 ++++ pkg/kinflate/commands/commands.go | 8 ++++++++ 2 files changed, 12 insertions(+) diff --git a/cmd/kinflate/kinflate.go b/cmd/kinflate/kinflate.go index a72ee30c3..0d01e925d 100644 --- a/cmd/kinflate/kinflate.go +++ b/cmd/kinflate/kinflate.go @@ -19,10 +19,14 @@ package main import ( "os" + "github.com/golang/glog" + "k8s.io/kubectl/pkg/kinflate/commands" ) func main() { + defer glog.Flush() + if err := commands.NewDefaultCommand().Execute(); err != nil { os.Exit(1) } diff --git a/pkg/kinflate/commands/commands.go b/pkg/kinflate/commands/commands.go index 378140a17..590ef3533 100644 --- a/pkg/kinflate/commands/commands.go +++ b/pkg/kinflate/commands/commands.go @@ -17,6 +17,7 @@ limitations under the License. package commands import ( + "flag" "io" "os" @@ -50,6 +51,13 @@ Find more information at: newCmdSet(stdOut, stdErr, fsys), ) + // add the glog flags + c.PersistentFlags().AddGoFlagSet(flag.CommandLine) + + // Workaround for this issue: + // https://github.com/kubernetes/kubernetes/issues/17162 + flag.CommandLine.Parse([]string{}) + return c }