mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-27 05:27:21 +00:00
Merge pull request #30440 from sttts/sttts-fix-kubectl-logtostderr
Automatic merge from submit-queue Fix glog's --v in kubectl With https://github.com/kubernetes/kubernetes/pull/29147 kubectl lost its glog output to stderr because the `init()` func did not run anymore which had set `logtostderr` to true before. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.kubernetes.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.kubernetes.io/reviews/kubernetes/kubernetes/30440) <!-- Reviewable:end -->
This commit is contained in:
commit
c51a89bc83
@ -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
Block a user