From e1c685ef3964895b34c6005b0b2e3eb7ff3030f2 Mon Sep 17 00:00:00 2001 From: ShyamsundarR Date: Mon, 11 Mar 2019 08:36:33 -0400 Subject: [PATCH] Fixed scope of confStore Signed-off-by: ShyamsundarR --- pkg/rbd/rbd.go | 6 +++--- pkg/rbd/rbd_util.go | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/pkg/rbd/rbd.go b/pkg/rbd/rbd.go index aa8dd3930..295752941 100644 --- a/pkg/rbd/rbd.go +++ b/pkg/rbd/rbd.go @@ -47,8 +47,8 @@ type Driver struct { var ( version = "1.0.0" - // ConfStore is the global config store - ConfStore *util.ConfigStore + // confStore is the global config store + confStore *util.ConfigStore ) // NewDriver returns new rbd driver @@ -94,7 +94,7 @@ func (r *Driver) Run(driverName, nodeID, endpoint string, containerized bool, co klog.Infof("Driver: %v version: %v", driverName, version) // Initialize config store - ConfStore, err = util.NewConfigStore(configroot) + confStore, err = util.NewConfigStore(configroot) if err != nil { klog.Fatalln("Failed to initialize config store.") } diff --git a/pkg/rbd/rbd_util.go b/pkg/rbd/rbd_util.go index f19535e03..1ed7455be 100644 --- a/pkg/rbd/rbd_util.go +++ b/pkg/rbd/rbd_util.go @@ -94,7 +94,7 @@ func getRBDKey(fsid string, id string, credentials map[string]string) (string, e if key, ok = credentials[id]; !ok { if fsid != "" { - key, err = ConfStore.CredentialForUser(fsid, id) + key, err = confStore.CredentialForUser(fsid, id) if err != nil { klog.Errorf("failed getting credentials (%s)", err) return "", fmt.Errorf("RBD key for ID: %s not found in config store", id) @@ -254,7 +254,7 @@ func getMonsAndFsID(options map[string]string) (monitors, fsID, monInSecret stri return } - if monitors, err = ConfStore.Mons(fsID); err != nil { + if monitors, err = confStore.Mons(fsID); err != nil { klog.Errorf("failed getting mons (%s)", err) err = fmt.Errorf("failed to fetch monitor list using clusterID (%s)", fsID) return @@ -272,7 +272,7 @@ func getIDs(options map[string]string, fsID string) (adminID, userID string, err switch { case ok: case fsID != "": - if adminID, err = ConfStore.AdminID(fsID); err != nil { + if adminID, err = confStore.AdminID(fsID); err != nil { klog.Errorf("failed getting subject (%s)", err) return "", "", fmt.Errorf("failed to fetch provisioner ID using clusterID (%s)", fsID) } @@ -284,7 +284,7 @@ func getIDs(options map[string]string, fsID string) (adminID, userID string, err switch { case ok: case fsID != "": - if userID, err = ConfStore.UserID(fsID); err != nil { + if userID, err = confStore.UserID(fsID); err != nil { klog.Errorf("failed getting subject (%s)", err) return "", "", fmt.Errorf("failed to fetch publisher ID using clusterID (%s)", fsID) }