From 57751a20bfea3e671f13677856d4ffccf18235f6 Mon Sep 17 00:00:00 2001 From: Zexi Li Date: Thu, 27 Jul 2023 12:19:21 +0800 Subject: [PATCH] fix(scheduler): auto allocation network selection is not working --- .../algorithm/predicates/network_schedtag_predicate.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/pkg/scheduler/algorithm/predicates/network_schedtag_predicate.go b/pkg/scheduler/algorithm/predicates/network_schedtag_predicate.go index bfbec4f18f..c341ea769c 100644 --- a/pkg/scheduler/algorithm/predicates/network_schedtag_predicate.go +++ b/pkg/scheduler/algorithm/predicates/network_schedtag_predicate.go @@ -97,10 +97,9 @@ func (p *NetworkSchedtagPredicate) IsResourceMatchInput(ctx context.Context, inp } func (p *NetworkSchedtagPredicate) IsResourceFitInput(ctx context.Context, u *core.Unit, c core.Candidater, res ISchedtagCandidateResource, input ISchedtagCustomer) core.PredicateFailureReason { - // network := res.(*api.CandidateNetwork) - // net := input.(*netW) - // return IsNetworkAvailable(ctx, c, u.SchedData(), net.NetworkConfig, network, p.GetNetworkTypes(net.NetType), nil) - return nil + network := res.(*api.CandidateNetwork) + net := input.(*netW) + return IsNetworkAvailable(ctx, c, u.SchedData(), net.NetworkConfig, network, p.GetNetworkTypes(net.NetType), nil) } func (p *NetworkSchedtagPredicate) GetNetworkTypes(specifyType string) []string {