aboutsummaryrefslogtreecommitdiff
path: root/src/dns_config.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/dns_config.rs')
-rw-r--r--src/dns_config.rs14
1 files changed, 4 insertions, 10 deletions
diff --git a/src/dns_config.rs b/src/dns_config.rs
index 25cc5f0..37a49fa 100644
--- a/src/dns_config.rs
+++ b/src/dns_config.rs
@@ -26,8 +26,7 @@ pub struct DnsConfig {
#[derive(Debug, Hash, PartialEq, Eq)]
pub struct DnsEntryKey {
- pub domain: String,
- pub subdomain: String,
+ pub dns_path: String,
pub record_type: DnsRecordType,
}
@@ -62,7 +61,7 @@ impl DnsConfig {
fn parse_d53_tag(tag: &str, node: &ConsulNode) -> Option<(DnsEntryKey, DnsEntryValue)> {
let splits = tag.split(' ').collect::<Vec<_>>();
- if splits.len() != 3 {
+ if splits.len() != 2 {
return None;
}
@@ -96,8 +95,7 @@ fn parse_d53_tag(tag: &str, node: &ConsulNode) -> Option<(DnsEntryKey, DnsEntryV
Some((
DnsEntryKey {
- domain: splits[1].to_string(),
- subdomain: splits[2].to_string(),
+ dns_path: splits[1].to_string(),
record_type,
},
DnsEntryValue { targets },
@@ -259,11 +257,7 @@ impl std::fmt::Display for DnsRecordType {
impl std::fmt::Display for DnsEntryKey {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
- write!(
- f,
- "{}.{} IN {}",
- self.subdomain, self.domain, self.record_type
- )
+ write!(f, "{} IN {}", self.dns_path, self.record_type)
}
}