From 2e9307269166a275c983e16e73b73afaca47d704 Mon Sep 17 00:00:00 2001 From: Zexi Li Date: Thu, 14 May 2020 18:09:26 +0800 Subject: [PATCH] scheduler: filter disabled cloudprovider --- pkg/scheduler/algorithm/predicates/guest/status_predicate.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/scheduler/algorithm/predicates/guest/status_predicate.go b/pkg/scheduler/algorithm/predicates/guest/status_predicate.go index 947eb3fa5a..ce4463d264 100644 --- a/pkg/scheduler/algorithm/predicates/guest/status_predicate.go +++ b/pkg/scheduler/algorithm/predicates/guest/status_predicate.go @@ -75,6 +75,9 @@ func (p *StatusPredicate) Execute(u *core.Unit, c core.Candidater) (bool, []core if !utils.IsInStringArray(cloudprovider.HealthStatus, api.CLOUD_PROVIDER_VALID_HEALTH_STATUS) { h.Exclude2("cloud_provider_health_status", cloudprovider.HealthStatus, api.CLOUD_PROVIDER_VALID_HEALTH_STATUS) } + if !cloudprovider.Enabled.Bool() { + h.Exclude2("cloud_provider_enable", cloudprovider.Enabled.Bool(), true) + } } return h.GetResult()