From 28dede02cb526e75260bd7c4c00fca61003f6af4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B1=88=E8=BD=A9?= Date: Wed, 17 Jul 2024 22:54:02 +0800 Subject: [PATCH] fix(region): support baremetal server as lb backend (#20838) --- pkg/compute/models/loadbalancerbackends.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/compute/models/loadbalancerbackends.go b/pkg/compute/models/loadbalancerbackends.go index 71df579638..75c32251bb 100644 --- a/pkg/compute/models/loadbalancerbackends.go +++ b/pkg/compute/models/loadbalancerbackends.go @@ -307,8 +307,8 @@ func (man *SLoadbalancerBackendManager) ValidateCreateData(ctx context.Context, host.Name, host.ZoneId, lb.Name, lb.ZoneId) } if len(lb.ManagerId) == 0 { - if !utils.IsInStringArray(host.HostType, []string{api.HOST_TYPE_HYPERVISOR, api.HOST_TYPE_ESXI}) { - return nil, httperrors.NewInputParameterError("host type of host %q (%s) should be either hypervisor or esxi", + if !utils.IsInStringArray(host.HostType, []string{api.HOST_TYPE_HYPERVISOR, api.HOST_TYPE_ESXI, api.HOST_TYPE_BAREMETAL}) { + return nil, httperrors.NewInputParameterError("host type of host %q (%s) should be either hypervisor, baremetal or esxi", host.Name, host.HostType) } } else if host.ManagerId != lb.ManagerId {