@@ -22,6 +22,7 @@ import (
22
22
"time"
23
23
24
24
"github.com/spf13/pflag"
25
+ "k8s.io/klog/v2"
25
26
26
27
// Import all Kubernetes client auth plugins (e.g. Azure, GCP, OIDC, etc.)
27
28
// to ensure that exec-entrypoint and run can make use of them.
@@ -32,7 +33,6 @@ import (
32
33
clientgoscheme "k8s.io/client-go/kubernetes/scheme"
33
34
"k8s.io/component-base/config"
34
35
"k8s.io/component-base/config/options"
35
- "k8s.io/klog/v2/textlogger"
36
36
"k8s.io/utils/clock"
37
37
ctrl "sigs.k8s.io/controller-runtime"
38
38
"sigs.k8s.io/controller-runtime/pkg/cache"
@@ -65,8 +65,7 @@ func init() {
65
65
}
66
66
67
67
func main () {
68
- textLoggerCfg := textlogger .NewConfig ()
69
- textLoggerCfg .AddFlags (flag .CommandLine )
68
+ klog .InitFlags (flag .CommandLine )
70
69
71
70
healthAddr := flag .String (
72
71
"health-addr" ,
@@ -86,7 +85,7 @@ func main() {
86
85
options .BindLeaderElectionFlags (& leaderElectionConfig , pflag .CommandLine )
87
86
pflag .Parse ()
88
87
89
- ctrl .SetLogger (textlogger . NewLogger ( textLoggerCfg ).WithName ("CCCMOConfigSyncControllers" ))
88
+ ctrl .SetLogger (klog . NewKlogr ( ).WithName ("CCCMOConfigSyncControllers" ))
90
89
91
90
restConfig := ctrl .GetConfigOrDie ()
92
91
le := util .GetLeaderElectionDefaults (restConfig , configv1.LeaderElection {
0 commit comments