mirror of https://github.com/k3s-io/k3s
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
parent
70d6d165d5
commit
e07e65d411
|
@ -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()
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue