@@ -22,6 +22,7 @@ import (
2222 "time"
2323
2424 "github.com/spf13/pflag"
25+ "k8s.io/klog/v2"
2526
2627 // Import all Kubernetes client auth plugins (e.g. Azure, GCP, OIDC, etc.)
2728 // to ensure that exec-entrypoint and run can make use of them.
@@ -32,7 +33,6 @@ import (
3233 clientgoscheme "k8s.io/client-go/kubernetes/scheme"
3334 "k8s.io/component-base/config"
3435 "k8s.io/component-base/config/options"
35- "k8s.io/klog/v2/textlogger"
3636 "k8s.io/utils/clock"
3737 ctrl "sigs.k8s.io/controller-runtime"
3838 "sigs.k8s.io/controller-runtime/pkg/cache"
@@ -65,8 +65,7 @@ func init() {
6565}
6666
6767func main () {
68- textLoggerCfg := textlogger .NewConfig ()
69- textLoggerCfg .AddFlags (flag .CommandLine )
68+ klog .InitFlags (flag .CommandLine )
7069
7170 healthAddr := flag .String (
7271 "health-addr" ,
@@ -86,7 +85,7 @@ func main() {
8685 options .BindLeaderElectionFlags (& leaderElectionConfig , pflag .CommandLine )
8786 pflag .Parse ()
8887
89- ctrl .SetLogger (textlogger . NewLogger ( textLoggerCfg ).WithName ("CCCMOConfigSyncControllers" ))
88+ ctrl .SetLogger (klog . NewKlogr ( ).WithName ("CCCMOConfigSyncControllers" ))
9089
9190 restConfig := ctrl .GetConfigOrDie ()
9291 le := util .GetLeaderElectionDefaults (restConfig , configv1.LeaderElection {
0 commit comments