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