Skip to content

Commit 3cded47

Browse files
committed
Fix missing logging output
1 parent 28a19af commit 3cded47

File tree

1 file changed

+2
-4
lines changed
  • cmd/cluster-cloud-controller-manager-operator

1 file changed

+2
-4
lines changed

cmd/cluster-cloud-controller-manager-operator/main.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ import (
3535
"k8s.io/component-base/config"
3636
"k8s.io/component-base/config/options"
3737
"k8s.io/klog/v2"
38-
"k8s.io/klog/v2/textlogger"
3938
ctrl "sigs.k8s.io/controller-runtime"
4039
"sigs.k8s.io/controller-runtime/pkg/cache"
4140
"sigs.k8s.io/controller-runtime/pkg/healthz"
@@ -77,8 +76,7 @@ func init() {
7776
}
7877

7978
func main() {
80-
textLoggerCfg := textlogger.NewConfig()
81-
textLoggerCfg.AddFlags(flag.CommandLine)
79+
klog.InitFlags(flag.CommandLine)
8280

8381
metricsAddr := flag.String(
8482
"metrics-bind-address",
@@ -109,7 +107,7 @@ func main() {
109107
options.BindLeaderElectionFlags(&leaderElectionConfig, pflag.CommandLine)
110108
pflag.Parse()
111109

112-
ctrl.SetLogger(textlogger.NewLogger(textLoggerCfg).WithName("CCMOperator"))
110+
ctrl.SetLogger(klog.NewKlogr().WithName("CCMOperator"))
113111

114112
restConfig := ctrl.GetConfigOrDie()
115113
le := util.GetLeaderElectionDefaults(restConfig, configv1.LeaderElection{

0 commit comments

Comments
 (0)