mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-28 22:17:14 +00:00
Merge pull request #70053 from gman0/fix-csiclient-lock
CSI client: added missing lock when reading from csiDrivers
This commit is contained in:
commit
322d0df3d2
@ -321,7 +321,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)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user