[边缘节点]可以同时通过关键词搜索集群和节点

This commit is contained in:
GoEdgeLab
2020-12-24 19:15:17 +08:00
parent 34e6f29aae
commit fe1e99bacc
7 changed files with 34 additions and 30 deletions

View File

@@ -162,12 +162,16 @@ func (this *NodeService) ListEnabledNodesMatch(ctx context.Context, req *pb.List
if err != nil {
return nil, err
}
dnsDomainId := int64(clusterDNS.DnsDomainId)
dnsDomainId := int64(0)
domainRoutes := []*dnsclients.Route{}
if clusterDNS.DnsDomainId > 0 {
domainRoutes, err = models.SharedDNSDomainDAO.FindDomainRoutes(dnsDomainId)
if err != nil {
return nil, err
if clusterDNS != nil {
dnsDomainId = int64(clusterDNS.DnsDomainId)
if clusterDNS.DnsDomainId > 0 {
domainRoutes, err = models.SharedDNSDomainDAO.FindDomainRoutes(dnsDomainId)
if err != nil {
return nil, err
}
}
}
@@ -285,7 +289,6 @@ func (this *NodeService) FindAllEnabledNodesWithClusterId(ctx context.Context, r
// TODO 检查权限
}
nodes, err := models.SharedNodeDAO.FindAllEnabledNodesWithClusterId(req.NodeClusterId)
if err != nil {
return nil, err