integrated glog in command structure

This commit is contained in:
Sunil Arora 2018-03-30 16:05:07 -07:00
parent a3fb1a16af
commit 04ab5927db
2 changed files with 12 additions and 0 deletions

View File

@ -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)
}

View File

@ -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
}