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 }