Setup logging in kubectl via pkg/util/logs

pkg/util/logs.go got its own package in a771578a1c, but it was not
imported in the kubelet anymore such that its init() func
did not run setting logtostderr to true by default.
pull/6/head
bindata-mockuser 2016-08-11 12:19:19 +02:00
parent 70d6d165d5
commit e07e65d411
1 changed files with 4 additions and 0 deletions

View File

@ -21,6 +21,7 @@ import (
"k8s.io/kubernetes/pkg/kubectl/cmd" "k8s.io/kubernetes/pkg/kubectl/cmd"
cmdutil "k8s.io/kubernetes/pkg/kubectl/cmd/util" cmdutil "k8s.io/kubernetes/pkg/kubectl/cmd/util"
"k8s.io/kubernetes/pkg/util/logs"
) )
/* /*
@ -28,6 +29,9 @@ WARNING: this logic is duplicated, with minor changes, in cmd/hyperkube/kubectl.
Any salient changes here will need to be manually reflected in that file. Any salient changes here will need to be manually reflected in that file.
*/ */
func Run() error { func Run() error {
logs.InitLogs()
defer logs.FlushLogs()
cmd := cmd.NewKubectlCommand(cmdutil.NewFactory(nil), os.Stdin, os.Stdout, os.Stderr) cmd := cmd.NewKubectlCommand(cmdutil.NewFactory(nil), os.Stdin, os.Stdout, os.Stderr)
return cmd.Execute() return cmd.Execute()
} }