Commit 571ad40f authored by gman's avatar gman

CSI client: added missing lock when reading from csiDrivers

parent 7cbb9995
...@@ -301,7 +301,10 @@ func newGrpcConn(driverName string) (*grpc.ClientConn, error) { ...@@ -301,7 +301,10 @@ func newGrpcConn(driverName string) (*grpc.ClientConn, error) {
addr := fmt.Sprintf(csiAddrTemplate, driverName) addr := fmt.Sprintf(csiAddrTemplate, driverName)
// TODO once KubeletPluginsWatcher graduates to beta, remove FeatureGate check // TODO once KubeletPluginsWatcher graduates to beta, remove FeatureGate check
if utilfeature.DefaultFeatureGate.Enabled(features.KubeletPluginsWatcher) { if utilfeature.DefaultFeatureGate.Enabled(features.KubeletPluginsWatcher) {
csiDrivers.RLock()
driver, ok := csiDrivers.driversMap[driverName] driver, ok := csiDrivers.driversMap[driverName]
csiDrivers.RUnlock()
if !ok { if !ok {
return nil, fmt.Errorf("driver name %s not found in the list of registered CSI drivers", driverName) return nil, fmt.Errorf("driver name %s not found in the list of registered CSI drivers", driverName)
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment