mirror of
https://github.com/EasyTier/EasyTier.git
synced 2026-09-02 17:15:43 +00:00
node_mgr: zone ordering
This commit is contained in:
@@ -61,6 +61,9 @@ impl DnsNodeMgr {
|
|||||||
|
|
||||||
pub fn catalog(&self) -> Catalog {
|
pub fn catalog(&self) -> Catalog {
|
||||||
let zones = self.collect_zones();
|
let zones = self.collect_zones();
|
||||||
|
|
||||||
|
tracing::warn!("building catalog with zones: {:?}", zones);
|
||||||
|
|
||||||
let mut catalog = Catalog::new();
|
let mut catalog = Catalog::new();
|
||||||
|
|
||||||
for zone in zones.iter() {
|
for zone in zones.iter() {
|
||||||
@@ -81,8 +84,8 @@ impl DnsNodeMgr {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn collect_zones(&self) -> ZoneGroup {
|
pub fn collect_zones(&self) -> ZoneGroup {
|
||||||
let mut zones = vec![Zone::system()];
|
let mut zones = Vec::new();
|
||||||
let mut local = HashSet::<NameServerAddr>::new();
|
let mut local = HashSet::new();
|
||||||
|
|
||||||
for (_, info) in self.nodes.iter() {
|
for (_, info) in self.nodes.iter() {
|
||||||
zones.extend(info.zones);
|
zones.extend(info.zones);
|
||||||
@@ -90,6 +93,8 @@ impl DnsNodeMgr {
|
|||||||
local.extend(info.listeners);
|
local.extend(info.listeners);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
zones.push(Zone::system());
|
||||||
|
|
||||||
for zone in zones.iter_mut() {
|
for zone in zones.iter_mut() {
|
||||||
if let Some(forward) = zone.forward.as_mut() {
|
if let Some(forward) = zone.forward.as_mut() {
|
||||||
forward
|
forward
|
||||||
|
|||||||
Reference in New Issue
Block a user