mirror of
https://github.com/TeaOSLab/EdgeAPI.git
synced 2025-12-09 19:50:30 +08:00
集群DNS设置中增加”包含Ln节点“选项
This commit is contained in:
@@ -1403,7 +1403,7 @@ func (this *NodeDAO) CountAllEnabledNodesWithRegionId(tx *dbs.Tx, regionId int64
|
||||
}
|
||||
|
||||
// FindAllEnabledNodesDNSWithClusterId 获取一个集群的节点DNS信息
|
||||
func (this *NodeDAO) FindAllEnabledNodesDNSWithClusterId(tx *dbs.Tx, clusterId int64, includeSecondaryNodes bool) (result []*Node, err error) {
|
||||
func (this *NodeDAO) FindAllEnabledNodesDNSWithClusterId(tx *dbs.Tx, clusterId int64, includeSecondaryNodes bool, includingLnNodes bool) (result []*Node, err error) {
|
||||
if clusterId <= 0 {
|
||||
return nil, nil
|
||||
}
|
||||
@@ -1415,6 +1415,9 @@ func (this *NodeDAO) FindAllEnabledNodesDNSWithClusterId(tx *dbs.Tx, clusterId i
|
||||
} else {
|
||||
query.Attr("clusterId", clusterId)
|
||||
}
|
||||
if !includingLnNodes {
|
||||
query.Lte("level", 1)
|
||||
}
|
||||
_, err = query.
|
||||
State(NodeStateEnabled).
|
||||
Attr("isOn", true).
|
||||
|
||||
Reference in New Issue
Block a user