Merge pull request #17505 from CloudCourierStation/master

fix fillStorage get storage cause scheduler panic
This commit is contained in:
Zexi Li
2023-07-13 15:24:44 +08:00
committed by GitHub
+4
View File
@@ -774,6 +774,10 @@ func (b *BaseHostDesc) fillStorages(host *computemodels.SHost) error {
ss := make([]*api.CandidateStorage, 0)
for _, s := range host.GetHoststorages() {
storage := s.GetStorage()
if storage == nil {
log.Warningf("%s invoke s.GetStorage return nil", storage.Id)
continue
}
cs := &api.CandidateStorage{
SStorage: storage,
ActualFreeCapacity: storage.Capacity - storage.ActualCapacityUsed,