aboutsummaryrefslogtreecommitdiff
path: root/src/rpc
diff options
context:
space:
mode:
Diffstat (limited to 'src/rpc')
-rw-r--r--src/rpc/system.rs17
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,