fix(region): data storage type (#20258)

This commit is contained in:
屈轩
2024-05-14 14:45:01 +08:00
committed by GitHub
parent 4658c179b9
commit ecec295c63
+14 -5
View File
@@ -780,12 +780,21 @@ func getStorageTypes(
}
if len(storage.StorageType) > 0 && len(storage.MediumType) > 0 {
storageType := fmt.Sprintf("%s/%s", storage.StorageType, storage.MediumType)
_, ok := ret.StorageTypes2[hostDriver.GetHypervisor()]
if !ok {
ret.StorageTypes2[hostDriver.GetHypervisor()] = []string{}
if storage.IsSysDiskStore {
_, ok := ret.StorageTypes2[hostDriver.GetHypervisor()]
if !ok {
ret.StorageTypes2[hostDriver.GetHypervisor()] = []string{}
}
if !utils.IsInStringArray(storageType, ret.StorageTypes2[hostDriver.GetHypervisor()]) {
ret.StorageTypes2[hostDriver.GetHypervisor()] = append(ret.StorageTypes2[hostDriver.GetHypervisor()], storageType)
}
}
if !utils.IsInStringArray(storageType, ret.StorageTypes2[hostDriver.GetHypervisor()]) {
ret.StorageTypes2[hostDriver.GetHypervisor()] = append(ret.StorageTypes2[hostDriver.GetHypervisor()], storageType)
_, ok := ret.DataStorageTypes2[hostDriver.GetHypervisor()]
if !ok {
ret.DataStorageTypes2[hostDriver.GetHypervisor()] = []string{}
}
if !utils.IsInStringArray(storageType, ret.DataStorageTypes2[hostDriver.GetHypervisor()]) {
ret.DataStorageTypes2[hostDriver.GetHypervisor()] = append(ret.DataStorageTypes2[hostDriver.GetHypervisor()], storageType)
}
simpleStorage := &SimpleStorageInfo{Storages: []sStorage{}}