aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2023-01-05 11:31:01 +0100
committerAlex Auvolat <alex@adnab.me>2023-01-05 11:31:01 +0100
commit63ebd97c7c3ca75a30b9465b0727b2d4cb87d3f8 (patch)
tree4f5424741f09d731905ae4aa8eaf3783fb863bbb
parenta0e276a6297706459e79a4ea76f1e69e6520f08b (diff)
downloadD53-63ebd97c7c3ca75a30b9465b0727b2d4cb87d3f8.tar.gz
D53-63ebd97c7c3ca75a30b9465b0727b2d4cb87d3f8.zip
Properly handle empty catalog (absent node)
-rw-r--r--Cargo.lock4
-rw-r--r--Cargo.toml2
-rw-r--r--src/dns_config.rs2
3 files changed, 4 insertions, 4 deletions
diff --git a/Cargo.lock b/Cargo.lock
index 60fce84..744d731 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -114,9 +114,9 @@ dependencies = [
[[package]]
name = "df-consul"
-version = "0.1.0"
+version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5ec5111d5daddfbab491780564dc8270c29c90553fab98d677489600a8623c76"
+checksum = "a351d00f138e768845cdefb9ae27b79aeed97c698745c73bb2805cad1167aa81"
dependencies = [
"anyhow",
"bytes",
diff --git a/Cargo.toml b/Cargo.toml
index 5a166d4..ecab429 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -12,7 +12,7 @@ anyhow = "1.0.66"
futures = "0.3"
tracing = { version = "0.1.30" }
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
-df-consul = "0.1.0"
+df-consul = "0.2.0"
structopt = "0.3"
tokio = { version = "1.22", default-features = false, features = ["rt", "rt-multi-thread", "io-util", "net", "time", "macros", "sync", "signal", "fs"] }
reqwest = { version = "0.11", default-features = false, features = ["json", "rustls-tls-webpki-roots" ] }
diff --git a/src/dns_config.rs b/src/dns_config.rs
index 37a49fa..4fe7c59 100644
--- a/src/dns_config.rs
+++ b/src/dns_config.rs
@@ -185,7 +185,7 @@ pub fn spawn_dns_config_task(
Ok((catalog, new_idx)) => {
let mut watch_state = nodes.get_mut(&node).unwrap();
watch_state.last_idx = Some(new_idx);
- watch_state.last_catalog = Some(catalog);
+ watch_state.last_catalog = catalog;
watch_state.retries = 0;
let idx = watch_state.last_idx;