fallback to globalLocalDrives for non-distributed setups

This commit is contained in:
Harshavardhana
2024-02-28 13:23:50 -08:00
parent 9a7c7ab2d0
commit f8696cc8f6
3 changed files with 19 additions and 0 deletions
+7
View File
@@ -78,6 +78,13 @@ var (
func getStorageViaEndpoint(endpoint Endpoint) StorageAPI {
globalLocalDrivesMu.RLock()
defer globalLocalDrivesMu.RUnlock()
if len(globalLocalSetDrives) == 0 {
for _, drive := range globalLocalDrives {
if drive != nil && drive.Endpoint().Equal(endpoint) {
return drive
}
}
}
return globalLocalSetDrives[endpoint.PoolIdx][endpoint.SetIdx][endpoint.DiskIdx]
}