Add klog.InitFlags to main.go

Signed-off-by: Humble Chirammal <hchiramm@redhat.com>
This commit is contained in:
Humble Chirammal 2019-02-04 18:32:56 +05:30 committed by mergify[bot]
parent 3ec0f04c49
commit 49d0c23812
2 changed files with 10 additions and 8 deletions

View File

@ -23,7 +23,7 @@ import (
"github.com/ceph/ceph-csi/pkg/cephfs" "github.com/ceph/ceph-csi/pkg/cephfs"
"github.com/ceph/ceph-csi/pkg/util" "github.com/ceph/ceph-csi/pkg/util"
"github.com/golang/glog" "k8s.io/klog"
) )
func init() { func init() {
@ -42,21 +42,22 @@ var (
) )
func main() { func main() {
klog.InitFlags(nil)
flag.Parse() flag.Parse()
if err := createPersistentStorage(path.Join(cephfs.PluginFolder, "controller")); err != nil { if err := createPersistentStorage(path.Join(cephfs.PluginFolder, "controller")); err != nil {
glog.Errorf("failed to create persistent storage for controller: %v", err) klog.Errorf("failed to create persistent storage for controller: %v", err)
os.Exit(1) os.Exit(1)
} }
if err := createPersistentStorage(path.Join(cephfs.PluginFolder, "node")); err != nil { if err := createPersistentStorage(path.Join(cephfs.PluginFolder, "node")); err != nil {
glog.Errorf("failed to create persistent storage for node: %v", err) klog.Errorf("failed to create persistent storage for node: %v", err)
os.Exit(1) os.Exit(1)
} }
cp, err := util.NewCachePersister(*metadataStorage, *driverName) cp, err := util.NewCachePersister(*metadataStorage, *driverName)
if err != nil { if err != nil {
glog.Errorf("failed to define cache persistence method: %v", err) klog.Errorf("failed to define cache persistence method: %v", err)
os.Exit(1) os.Exit(1)
} }

View File

@ -23,7 +23,7 @@ import (
"github.com/ceph/ceph-csi/pkg/rbd" "github.com/ceph/ceph-csi/pkg/rbd"
"github.com/ceph/ceph-csi/pkg/util" "github.com/ceph/ceph-csi/pkg/util"
"github.com/golang/glog" "k8s.io/klog"
) )
func init() { func init() {
@ -42,20 +42,21 @@ var (
) )
func main() { func main() {
klog.InitFlags(nil)
flag.Parse() flag.Parse()
if err := createPersistentStorage(path.Join(rbd.PluginFolder, "controller")); err != nil { if err := createPersistentStorage(path.Join(rbd.PluginFolder, "controller")); err != nil {
glog.Errorf("failed to create persistent storage for controller %v", err) klog.Errorf("failed to create persistent storage for controller %v", err)
os.Exit(1) os.Exit(1)
} }
if err := createPersistentStorage(path.Join(rbd.PluginFolder, "node")); err != nil { if err := createPersistentStorage(path.Join(rbd.PluginFolder, "node")); err != nil {
glog.Errorf("failed to create persistent storage for node %v", err) klog.Errorf("failed to create persistent storage for node %v", err)
os.Exit(1) os.Exit(1)
} }
cp, err := util.NewCachePersister(*metadataStorage, *driverName) cp, err := util.NewCachePersister(*metadataStorage, *driverName)
if err != nil { if err != nil {
glog.Errorf("failed to define cache persistence method: %v", err) klog.Errorf("failed to define cache persistence method: %v", err)
os.Exit(1) os.Exit(1)
} }