mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-24 16:03:43 +08:00
fix(scheduler): Candidater's CloudProvider maybe nil
Candidater(Host) in Provider Onecloud doesn't have CloudProvider.
This commit is contained in:
@@ -227,7 +227,9 @@ func (cm *CandidateManager) GetCandidates(args CandidateGetArgs) ([]core.Candida
|
||||
|
||||
matchCloudprovider := func(r core.Candidater, managerId string) bool {
|
||||
if managerId != "" {
|
||||
if r.Getter().Cloudprovider().GetId() == managerId {
|
||||
cloudProvier := r.Getter().Cloudprovider()
|
||||
// r who belongs to Provider Onecloud doesn't have cloudprovider
|
||||
if cloudProvier != nil && cloudProvier.GetId() == managerId {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
|
||||
Reference in New Issue
Block a user