节点IP地址可以设置专属集群

This commit is contained in:
GoEdgeLab
2023-03-01 11:38:53 +08:00
parent 074d668644
commit cb6919a073
8 changed files with 200 additions and 72 deletions

View File

@@ -1347,6 +1347,11 @@ func (this *NodeService) FindAllEnabledNodesDNSWithNodeClusterId(ctx context.Con
}
for _, ipAddress := range ipAddresses {
// 检查专属节点
if !ipAddress.IsValidInCluster(req.NodeClusterId) {
continue
}
var ip = ipAddress.DNSIP()
if len(ip) == 0 {
continue
@@ -1539,7 +1544,7 @@ func (this *NodeService) UpdateNodeDNS(ctx context.Context, req *pb.UpdateNodeDN
return nil, err
}
} else {
_, err = models.SharedNodeIPAddressDAO.CreateAddress(tx, adminId, req.NodeId, nodeconfigs.NodeRoleNode, "DNS IP", req.IpAddr, true, true, 0)
_, err = models.SharedNodeIPAddressDAO.CreateAddress(tx, adminId, req.NodeId, nodeconfigs.NodeRoleNode, "DNS IP", req.IpAddr, true, true, 0, nil)
if err != nil {
return nil, err
}