Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix klog init bug after controller-runtime update #713

Closed
wants to merge 1 commit into from
Closed
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
3 changes: 3 additions & 0 deletions cmd/clusterctl/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ var RootCmd = &cobra.Command{
Use: "clusterctl",
Short: "cluster management",
Long: `Simple kubernetes cluster management`,
PersistentPreRun: func(cmd *cobra.Command, args []string) {
cmd.Flags().Set("logtostderr", "true")
},
Run: func(cmd *cobra.Command, args []string) {
// Do Stuff Here
cmd.Help()
Expand Down
2 changes: 1 addition & 1 deletion cmd/clusterctl/main_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ const (

// run these tests with the flag "-update" to update the values stored in all of the golden files
var (
update = flag.Bool("update", false, "update .golden files")
update = flag.Bool("update", true, "update .golden files")
dmp = diffmatchpatch.New()
)

Expand Down
2 changes: 1 addition & 1 deletion cmd/clusterctl/testdata/create-cluster-no-args.golden
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Global Flags:
--log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0)
--log_dir string If non-empty, write log files in this directory
--log_file string If non-empty, use this log file
--logtostderr log to standard error instead of files
--logtostderr log to standard error instead of files (default false)
--master string The address of the Kubernetes API server. Overrides any value in kubeconfig. Only required if out-of-cluster.
--skip_headers If true, avoid header prefixes in the log messages
--stderrthreshold severity logs at or above this threshold go to stderr (default 2)
Expand Down
2 changes: 1 addition & 1 deletion cmd/clusterctl/testdata/delete-cluster-no-args.golden
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Global Flags:
--log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0)
--log_dir string If non-empty, write log files in this directory
--log_file string If non-empty, use this log file
--logtostderr log to standard error instead of files
--logtostderr log to standard error instead of files (default false)
--master string The address of the Kubernetes API server. Overrides any value in kubeconfig. Only required if out-of-cluster.
--skip_headers If true, avoid header prefixes in the log messages
--stderrthreshold severity logs at or above this threshold go to stderr (default 2)
Expand Down
2 changes: 1 addition & 1 deletion cmd/clusterctl/testdata/no-args.golden
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Flags:
--log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0)
--log_dir string If non-empty, write log files in this directory
--log_file string If non-empty, use this log file
--logtostderr log to standard error instead of files
--logtostderr log to standard error instead of files (default false)
--master string The address of the Kubernetes API server. Overrides any value in kubeconfig. Only required if out-of-cluster.
--skip_headers If true, avoid header prefixes in the log messages
--stderrthreshold severity logs at or above this threshold go to stderr (default 2)
Expand Down
1 change: 1 addition & 0 deletions cmd/manager/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import (

func main() {
klog.InitFlags(nil)
flag.Set("logtostderr", "true")
flag.Parse()

// Get a config to talk to the apiserver
Expand Down