Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions channels/cmd/channels/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ package main

import (
"context"
"flag"
"fmt"
"os"

Expand All @@ -35,6 +36,11 @@ func main() {

func run(ctx context.Context) error {
klog.InitFlags(nil)
// Opt into the new klog behavior so that -stderrthreshold is honored even
// when -logtostderr=true (the default).
// Ref: kubernetes/klog#212, kubernetes/klog#432
flag.Set("legacy_stderr_threshold_behavior", "false") //nolint:errcheck
flag.Set("stderrthreshold", "INFO") //nolint:errcheck

f := cmd.NewChannelsFactory()

Expand Down
5 changes: 5 additions & 0 deletions cmd/kops-controller/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,11 @@ func main() {
ctx := context.Background()

klog.InitFlags(nil)
// Opt into the new klog behavior so that -stderrthreshold is honored even
// when -logtostderr=true (the default).
// Ref: kubernetes/klog#212, kubernetes/klog#432
flag.Set("legacy_stderr_threshold_behavior", "false") //nolint:errcheck
flag.Set("stderrthreshold", "INFO") //nolint:errcheck

// Disable metrics by default (avoid port conflicts, also risky because we are host network)
metricsAddress := ":0"
Expand Down
4 changes: 3 additions & 1 deletion cmd/kops/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,9 @@ func init() {
cobra.OnInitialize(initConfig)

klog.InitFlags(nil)
// Opt into fixed stderrthreshold behavior (kubernetes/klog#212).
// Opt into the new klog behavior so that -stderrthreshold is honored even
// when -logtostderr=true (the default).
// Ref: kubernetes/klog#212, kubernetes/klog#432
_ = goflag.Set("legacy_stderr_threshold_behavior", "false")
_ = goflag.Set("stderrthreshold", "INFO")

Expand Down
5 changes: 5 additions & 0 deletions cmd/kube-apiserver-healthcheck/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,11 @@ func run() error {
flag.StringVar(&caCert, "ca-cert", caCert, "path to ca certificate")

klog.InitFlags(nil)
// Opt into the new klog behavior so that -stderrthreshold is honored even
// when -logtostderr=true (the default).
// Ref: kubernetes/klog#212, kubernetes/klog#432
flag.Set("legacy_stderr_threshold_behavior", "false") //nolint:errcheck
flag.Set("stderrthreshold", "INFO") //nolint:errcheck

flag.Parse()

Expand Down
5 changes: 5 additions & 0 deletions cmd/nodeup/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ const (

func main() {
klog.InitFlags(nil)
// Opt into the new klog behavior so that -stderrthreshold is honored even
// when -logtostderr=true (the default).
// Ref: kubernetes/klog#212, kubernetes/klog#432
flag.Set("legacy_stderr_threshold_behavior", "false") //nolint:errcheck
flag.Set("stderrthreshold", "INFO") //nolint:errcheck

var flagConf, flagCacheDir, gitVersion string
var flagRetries int
Expand Down
5 changes: 5 additions & 0 deletions dns-controller/cmd/dns-controller/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,11 @@ func main() {

// Be sure to get the glog flags
klog.InitFlags(nil)
// Opt into the new klog behavior so that -stderrthreshold is honored even
// when -logtostderr=true (the default).
// Ref: kubernetes/klog#212, kubernetes/klog#432
flag.Set("legacy_stderr_threshold_behavior", "false") //nolint:errcheck
flag.Set("stderrthreshold", "INFO") //nolint:errcheck
klog.Flush()

flag.StringVar(&dnsServer, "dns-server", "", "DNS Server")
Expand Down
5 changes: 5 additions & 0 deletions protokube/cmd/protokube/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@ var (

func main() {
klog.InitFlags(nil)
// Opt into the new klog behavior so that -stderrthreshold is honored even
// when -logtostderr=true (the default).
// Ref: kubernetes/klog#212, kubernetes/klog#432
flag.Set("legacy_stderr_threshold_behavior", "false") //nolint:errcheck
flag.Set("stderrthreshold", "INFO") //nolint:errcheck

fmt.Printf("protokube version %s\n", BuildVersion)

Expand Down
5 changes: 5 additions & 0 deletions tests/e2e/kubetest2-kops/deployer/deployer.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,11 @@ func New(opts types.Options) (types.Deployer, *pflag.FlagSet) {
// register flags for klog
klogFlags := flag.NewFlagSet("klog", flag.ExitOnError)
klog.InitFlags(klogFlags)
// Opt into the new klog behavior so that -stderrthreshold is honored even
// when -logtostderr=true (the default).
// Ref: kubernetes/klog#212, kubernetes/klog#432
_ = klogFlags.Set("legacy_stderr_threshold_behavior", "false")
_ = klogFlags.Set("stderrthreshold", "INFO")
fs.AddGoFlagSet(klogFlags)

return d, fs
Expand Down
5 changes: 5 additions & 0 deletions tools/otel/traceserver/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,11 @@ func run(ctx context.Context) error {
flag.StringVar(&listen, "listen", listen, "endpoint on which to serve grpc")
flag.StringVar(&run, "run", run, "visualization program to run [jaeger, docker-jaeger]")
klog.InitFlags(nil)
// Opt into the new klog behavior so that -stderrthreshold is honored even
// when -logtostderr=true (the default).
// Ref: kubernetes/klog#212, kubernetes/klog#432
flag.Set("legacy_stderr_threshold_behavior", "false") //nolint:errcheck
flag.Set("stderrthreshold", "INFO") //nolint:errcheck
flag.Parse()

if src == "" {
Expand Down
6 changes: 6 additions & 0 deletions upup/tools/generators/fitask/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ limitations under the License.
package main

import (
"flag"
"os"

"k8s.io/gengo/args"
Expand All @@ -25,6 +26,11 @@ import (

func main() {
klog.InitFlags(nil)
// Opt into the new klog behavior so that -stderrthreshold is honored even
// when -logtostderr=true (the default).
// Ref: kubernetes/klog#212, kubernetes/klog#432
flag.Set("legacy_stderr_threshold_behavior", "false") //nolint:errcheck
flag.Set("stderrthreshold", "INFO") //nolint:errcheck
arguments := args.Default()
if err := arguments.Execute(
NameSystems(),
Expand Down
Loading