move things around

This commit is contained in:
Alex 2022-10-18 19:13:52 +02:00
parent 5d8d393054
commit 2da8786f54
Signed by untrusted user: lx
GPG key ID: 0E496D15096376BE

View file

@ -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,