Merge pull request #70053 from gman0/fix-csiclient-lock

CSI client: added missing lock when reading from csiDrivers
pull/58/head
k8s-ci-robot 2018-10-23 02:08:32 -07:00 committed by GitHub
commit 322d0df3d2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -321,7 +321,10 @@ func newGrpcConn(driverName string) (*grpc.ClientConn, error) {
addr := fmt.Sprintf(csiAddrTemplate, driverName)
// TODO once KubeletPluginsWatcher graduates to beta, remove FeatureGate check
if utilfeature.DefaultFeatureGate.Enabled(features.KubeletPluginsWatcher) {
csiDrivers.RLock()
driver, ok := csiDrivers.driversMap[driverName]
csiDrivers.RUnlock()
if !ok {
return nil, fmt.Errorf("driver name %s not found in the list of registered CSI drivers", driverName)
}