fix(region): ignore classic vpc checkout while add lb backend

阿里云公网EL属于经典网络,在添加后端服务器时,不需要LB VPC和服务器的vpc 完全匹配

#6040
#6404
This commit is contained in:
TangBin
2020-11-20 11:08:47 +08:00
parent 39bc3037d6
commit 4e811240e4
+2 -1
View File
@@ -187,7 +187,8 @@ func (man *SLoadbalancerBackendManager) ValidateBackendVpc(lb *SLoadbalancer, gu
return httperrors.NewBadRequestError("%s", err)
}
if len(lb.VpcId) > 0 {
if vpc.Id != lb.VpcId {
lbVpc := lb.GetVpc()
if lbVpc != nil && !lbVpc.IsEmulated && vpc.Id != lb.VpcId {
return httperrors.NewBadRequestError("guest %s(%s) vpc %s(%s) not same as loadbalancer vpc %s", guest.Name, guest.Id, vpc.Name, vpc.Id, lb.VpcId)
}
return nil