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:
Zexi Li
2020-03-13 11:28:05 +08:00
committed by GitHub
@@ -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