From 6e06d6eea208e21abd67892d838239768414d064 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E5=85=B8=E7=A7=8B?= Date: Thu, 13 Jul 2023 08:34:24 +0800 Subject: [PATCH] fix fillStorage get storage cause scheduler panic --- pkg/scheduler/cache/candidate/base.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/scheduler/cache/candidate/base.go b/pkg/scheduler/cache/candidate/base.go index cf7909bb92..033cff9bc2 100644 --- a/pkg/scheduler/cache/candidate/base.go +++ b/pkg/scheduler/cache/candidate/base.go @@ -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,