Skip to content
This repository has been archived by the owner on May 6, 2022. It is now read-only.

Commit

Permalink
force go flag initialization to satisfy glog that cmd line parameters…
Browse files Browse the repository at this point in the history
… have been

initialized.  Fixes issue 1187.
  • Loading branch information
Jay Boyd committed Sep 7, 2017
1 parent 154b74d commit c924db0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cmd/apiserver/apiserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ limitations under the License.
package main

import (
"flag"
"os"

"github.com/golang/glog"
Expand All @@ -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()
Expand Down
4 changes: 4 additions & 0 deletions cmd/controller-manager/controller-manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ limitations under the License.
package main

import (
goflag "flag"
"fmt"
"os"

Expand All @@ -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)
Expand Down

0 comments on commit c924db0

Please sign in to comment.