实现完整的集群、域名同步

This commit is contained in:
刘祥超
2020-11-14 21:28:07 +08:00
parent 9f67a584b4
commit 2da1ab384c
12 changed files with 507 additions and 172 deletions

View File

@@ -828,26 +828,6 @@ func (this *ServerDAO) FindAllServerDNSNamesWithDNSDomainId(dnsDomainId int64) (
return result, nil
}
// 查找DNS名称为空的所有服务
func (this *ServerDAO) FindAllServersToFixWithDNSDomainId(dnsDomainId int64) (result []*Server, err error) {
clusterIds, err := SharedNodeClusterDAO.FindAllEnabledClusterIdsWithDNSDomainId(dnsDomainId)
if err != nil {
return nil, err
}
if len(clusterIds) == 0 {
return nil, nil
}
_, err = this.Query().
State(ServerStateEnabled).
Attr("isOn", true).
Attr("clusterId", clusterIds).
Result("dnsName").
Reuse(false). // 避免因为IN语句造成内存占用过多
Slice(&result).
FindAll()
return
}
// 获取某个集群下的服务DNS信息
func (this *ServerDAO) FindAllServersDNSWithClusterId(clusterId int64) (result []*Server, err error) {
_, err = this.Query().