From 4b5952d15a8b99219b6878a094d2e27fc3fa9b09 Mon Sep 17 00:00:00 2001 From: Madhu Rajanna Date: Wed, 19 Aug 2020 16:11:13 +0530 Subject: [PATCH] rbd: replace klog with util logger in driver.go replace klog with util logger in driver.go Signed-off-by: Madhu Rajanna (cherry picked from commit 883485b082f57c2adaf8286abf3e4ffa56b4461e) --- internal/rbd/driver.go | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/internal/rbd/driver.go b/internal/rbd/driver.go index 7d873ac16..ff2d16f78 100644 --- a/internal/rbd/driver.go +++ b/internal/rbd/driver.go @@ -22,7 +22,6 @@ import ( "github.com/ceph/ceph-csi/internal/util" "github.com/container-storage-interface/spec/lib/go/csi" - klog "k8s.io/klog/v2" "k8s.io/utils/mount" ) @@ -99,7 +98,7 @@ func (r *Driver) Run(conf *util.Config) { // Create ceph.conf for use with CLI commands if err = util.WriteCephConfig(); err != nil { - klog.Fatalf("failed to write ceph configuration file (%v)", err) + util.FatalLogMsg("failed to write ceph configuration file (%v)", err) } // Use passed in instance ID, if provided for omap suffix naming @@ -119,7 +118,7 @@ func (r *Driver) Run(conf *util.Config) { // Initialize default library driver r.cd = csicommon.NewCSIDriver(conf.DriverName, util.DriverVersion, conf.NodeID) if r.cd == nil { - klog.Fatalln("Failed to initialize CSI Driver.") + util.FatalLogMsg("Failed to initialize CSI Driver.") } if conf.IsControllerServer || !conf.IsNodeServer { r.cd.AddControllerServiceCapabilities([]csi.ControllerServiceCapability_RPC_Type{ @@ -143,11 +142,11 @@ func (r *Driver) Run(conf *util.Config) { if conf.IsNodeServer { topology, err = util.GetTopologyFromDomainLabels(conf.DomainLabels, conf.NodeID, conf.DriverName) if err != nil { - klog.Fatalln(err) + util.FatalLogMsg(err.Error()) } r.ns, err = NewNodeServer(r.cd, conf.Vtype, topology) if err != nil { - klog.Fatalf("failed to start node server, err %v\n", err) + util.FatalLogMsg("failed to start node server, err %v\n", err) } } @@ -157,11 +156,11 @@ func (r *Driver) Run(conf *util.Config) { if !conf.IsControllerServer && !conf.IsNodeServer { topology, err = util.GetTopologyFromDomainLabels(conf.DomainLabels, conf.NodeID, conf.DriverName) if err != nil { - klog.Fatalln(err) + util.FatalLogMsg(err.Error()) } r.ns, err = NewNodeServer(r.cd, conf.Vtype, topology) if err != nil { - klog.Fatalf("failed to start node server, err %v\n", err) + util.FatalLogMsg("failed to start node server, err %v\n", err) } r.cs = NewControllerServer(r.cd) } @@ -169,7 +168,7 @@ func (r *Driver) Run(conf *util.Config) { s := csicommon.NewNonBlockingGRPCServer() s.Start(conf.Endpoint, conf.HistogramOption, r.ids, r.cs, r.ns, conf.EnableGRPCMetrics) if conf.EnableGRPCMetrics { - klog.Warning("EnableGRPCMetrics is deprecated") + util.WarningLogMsg("EnableGRPCMetrics is deprecated") go util.StartMetricsServer(conf) } s.Wait()