Skip to content
Open
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
5 changes: 5 additions & 0 deletions cmd/recorder/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,11 @@ func run(ctx context.Context) error {
// Support default klog verbosity (so that we can see client-go traffic)
klogFlagSet := goflag.NewFlagSet("klog", goflag.ExitOnError)
klog.InitFlags(klogFlagSet)
// Opt into the new klog behavior so that -stderrthreshold is honored even
// when -logtostderr=true (the default).
// Ref: kubernetes/klog#212, kubernetes/klog#432
_ = klogFlagSet.Set("legacy_stderr_threshold_behavior", "false")
_ = klogFlagSet.Set("stderrthreshold", "INFO")
flag.CommandLine.AddGoFlag(klogFlagSet.Lookup("v"))

flag.CommandLine.AddGoFlagSet(goflag.CommandLine)
Expand Down
5 changes: 5 additions & 0 deletions dev/tasks/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,11 @@ func run(ctx context.Context) error {
addVPrefix := false
flag.BoolVar(&addVPrefix, "add-v-prefix", addVPrefix, "prefix tag with 'v'")
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 branch == "" {
Expand Down
5 changes: 5 additions & 0 deletions dev/tools/controllerbuilder/cmd/benchmark/type/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@ func run(ctx context.Context) error {
var o Options

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.StringVar(&o.predictPath, "predict-path", o.predictPath, "the path to the bash script where the prediction job is run.")
flag.StringVar(&o.BaseDir, "base-dir", o.BaseDir, "base directory for the project code")
Expand Down
5 changes: 5 additions & 0 deletions dev/tools/controllerbuilder/cmd/codebot/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,11 @@ func (cb *CodeBot) run(ctx context.Context) error {
o.InitDefaults()

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.StringVar(&o.ProtoDir, "proto-dir", o.ProtoDir, "base directory for checkout of proto API definitions")
flag.StringVar(&o.BaseDir, "base-dir", o.BaseDir, "base directory for the project code")
Expand Down
5 changes: 5 additions & 0 deletions dev/tools/controllerbuilder/cmd/ctf/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@ func run(ctx context.Context) error {
options.AddFlags(flag.CommandLine)

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 scenario == "" {
Expand Down
2 changes: 1 addition & 1 deletion dev/tools/controllerbuilder/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ require (
gopkg.in/yaml.v3 v3.0.1
k8s.io/apimachinery v0.34.2
k8s.io/klog v1.0.0
k8s.io/klog/v2 v2.130.1
k8s.io/klog/v2 v2.140.0
sigs.k8s.io/yaml v1.6.0
)

Expand Down
4 changes: 2 additions & 2 deletions dev/tools/controllerbuilder/go.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion experiments/tools/licensescan/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ toolchain go1.26.1
require (
github.com/spf13/cobra v1.8.1
golang.org/x/mod v0.33.0
k8s.io/klog/v2 v2.130.1
k8s.io/klog/v2 v2.140.0
sigs.k8s.io/yaml v1.4.0
)

Expand Down
4 changes: 2 additions & 2 deletions experiments/tools/licensescan/go.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions experiments/tools/licensescan/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (
"debug/buildinfo"
"embed"
"encoding/json"
"flag"
"fmt"
"io"
"io/fs"
Expand Down Expand Up @@ -59,6 +60,11 @@ func buildRootCommand() *cobra.Command {
cmd.AddCommand(buildLicenseGenerateCommand())

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

return cmd
}
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ require (
k8s.io/apiextensions-apiserver v0.33.10
k8s.io/apimachinery v0.33.10
k8s.io/client-go v0.33.10
k8s.io/klog/v2 v2.130.1
k8s.io/klog/v2 v2.140.0
sigs.k8s.io/controller-runtime v0.20.4
sigs.k8s.io/controller-tools v0.16.5
sigs.k8s.io/kubebuilder-declarative-pattern v0.20.0-beta.1.0.20250514194322-871029137730
Expand Down Expand Up @@ -333,7 +333,7 @@ replace (
k8s.io/client-go => k8s.io/client-go v0.33.10
k8s.io/code-generator => k8s.io/code-generator v0.33.10
k8s.io/component-base => k8s.io/component-base v0.33.10
k8s.io/klog/v2 => k8s.io/klog/v2 v2.130.1
k8s.io/klog/v2 => k8s.io/klog/v2 v2.140.0
k8s.io/kube-openapi => k8s.io/kube-openapi v0.0.0-20250318190949-c8a335a9a2ff
k8s.io/kubectl => k8s.io/kubectl v0.32.1
sigs.k8s.io/yaml => sigs.k8s.io/yaml v1.4.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion mockgcp/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ require (
google.golang.org/protobuf v1.36.11
k8s.io/api v0.33.10
k8s.io/apimachinery v0.33.10
k8s.io/klog/v2 v2.130.1
k8s.io/klog/v2 v2.140.0
sigs.k8s.io/controller-runtime v0.20.4
sigs.k8s.io/yaml v1.6.0
)
Expand Down
12 changes: 6 additions & 6 deletions mockgcp/go.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions mockgcp/tools/gapic/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,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

var opt protogen.ConvertOptions
opt.NormalizeLRO = true
Expand Down
5 changes: 5 additions & 0 deletions pkg/cli/cmd/preview/execute.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@ func Execute(ctx context.Context, opts *Options) error {
// Use a custom FlagSet for klog to avoid conflicts with global flag.CommandLine
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")
if err := klogFlags.Set("v", fmt.Sprintf("%d", opts.Verbose)); err != nil {
fmt.Printf("Failed to set -v flag: %v\n", err)
}
Expand Down
5 changes: 5 additions & 0 deletions pkg/test/main/testmain.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@ func ForIntegrationTests(m *testing.M, mgr *manager.Manager) {

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")

// Sync the log and klog flags.
flag.CommandLine.VisitAll(func(f1 *flag.Flag) {
Expand Down