diff options
author | Alex Auvolat <alex@adnab.me> | 2022-10-18 19:13:52 +0200 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2022-10-18 19:13:52 +0200 |
commit | 2da8786f54dcf13bed51549f818a1af3bbebaa8c (patch) | |
tree | b26db9a83f8ca31c6c26acac6c0635b4ac28d620 | |
parent | 5d8d393054f9aa9364fde6af119366953a54081d (diff) | |
download | garage-2da8786f54dcf13bed51549f818a1af3bbebaa8c.tar.gz garage-2da8786f54dcf13bed51549f818a1af3bbebaa8c.zip |
move things around
-rw-r--r-- | src/rpc/system.rs | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/src/rpc/system.rs b/src/rpc/system.rs index 61e380c9..d6576f20 100644 --- a/src/rpc/system.rs +++ b/src/rpc/system.rs @@ -290,6 +290,14 @@ impl System { let system_endpoint = netapp.endpoint(SYSTEM_RPC_PATH.into()); + #[cfg(feature = "consul-discovery")] + let consul_discovery = match &config.consul_discovery { + Some(cfg) => Some( + ConsulDiscovery::new(cfg.clone()) + .ok_or_message("Invalid Consul discovery configuration")?, + ), + None => None, + }; #[cfg(not(feature = "consul-discovery"))] if config.consul_discovery.is_some() { warn!("Consul discovery is not enabled in this build."); @@ -300,15 +308,6 @@ impl System { warn!("Kubernetes discovery is not enabled in this build."); } - #[cfg(feature = "consul-discovery")] - let consul_discovery = match &config.consul_discovery { - Some(cfg) => Some( - ConsulDiscovery::new(cfg.clone()) - .ok_or_message("Invalid Consul discovery configuration")?, - ), - None => None, - }; - let sys = Arc::new(System { id: netapp.id.into(), persist_cluster_layout, |