From 2da8786f54dcf13bed51549f818a1af3bbebaa8c Mon Sep 17 00:00:00 2001 From: Alex Auvolat Date: Tue, 18 Oct 2022 19:13:52 +0200 Subject: move things around --- src/rpc/system.rs | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'src/rpc') 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, -- cgit v1.2.3