File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed
cmd/controller-manager/app Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -127,6 +127,13 @@ func NewControllerManagerCommand(ctx context.Context) *cobra.Command {
127
127
return err
128
128
}
129
129
logs .InitLogs ()
130
+
131
+ // Starting from version 0.15.0, controller-runtime expects its consumers to set a logger through log.SetLogger.
132
+ // If SetLogger is not called within the first 30 seconds of a binaries lifetime, it will get
133
+ // set to a NullLogSink and report an error. Here's to silence the "log.SetLogger(...) was never called; logs will not be displayed" error
134
+ // by setting a logger through log.SetLogger.
135
+ // More info refer to: https://github.com/karmada-io/karmada/pull/4885.
136
+ controllerruntime .SetLogger (klog .Background ())
130
137
return nil
131
138
},
132
139
You can’t perform that action at this time.
0 commit comments