From c924db00c573a438878355350ef62c1abea4e6ca Mon Sep 17 00:00:00 2001 From: Jay Boyd Date: Thu, 7 Sep 2017 10:26:25 -0400 Subject: [PATCH] force go flag initialization to satisfy glog that cmd line parameters have been initialized. Fixes issue 1187. --- cmd/apiserver/apiserver.go | 4 ++++ cmd/controller-manager/controller-manager.go | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/cmd/apiserver/apiserver.go b/cmd/apiserver/apiserver.go index 7eadf131aa7..afcb00bf1be 100644 --- a/cmd/apiserver/apiserver.go +++ b/cmd/apiserver/apiserver.go @@ -20,6 +20,7 @@ limitations under the License. package main import ( + "flag" "os" "github.com/golang/glog" @@ -37,6 +38,9 @@ import ( ) func main() { + // flag init workaround required to quell glog noise + flag.CommandLine.Parse([]string{}) + logs.InitLogs() // make sure we print all the logs while shutting down. defer logs.FlushLogs() diff --git a/cmd/controller-manager/controller-manager.go b/cmd/controller-manager/controller-manager.go index 8e60e181b25..621951f0db0 100644 --- a/cmd/controller-manager/controller-manager.go +++ b/cmd/controller-manager/controller-manager.go @@ -21,6 +21,7 @@ limitations under the License. package main import ( + goflag "flag" "fmt" "os" @@ -40,6 +41,9 @@ func init() { } func main() { + // flag init workaround required to quell glog noise + goflag.CommandLine.Parse([]string{}) + s := options.NewControllerManagerServer() s.AddFlags(pflag.CommandLine) version := pkg.VersionFlag(pflag.CommandLine)