mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-24 16:03:43 +08:00
Merge pull request #5485 from rainzm/automated-cherry-pick-of-#5479-upstream-release-3.1
Automated cherry pick of #5479: fix(scheduler): Candidater's CloudProvider maybe nil
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