Skip to content

Commit

Permalink
fix exiting cp
Browse files Browse the repository at this point in the history
  • Loading branch information
hanneary committed Dec 17, 2024
1 parent e730927 commit 533b292
Showing 1 changed file with 13 additions and 49 deletions.
62 changes: 13 additions & 49 deletions control-plane/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,74 +63,38 @@ async fn main() -> Result<()> {

let config_server = config_server::ConfigServer::new(cert_provisioner_client, acme_s3_client);

#[cfg(not(feature = "network_egress"))]
{
listen_for_shutdown_signal();

tokio::spawn(e3_proxy.listen());

tokio::spawn(tcp_server());
listen_for_shutdown_signal();

tokio::spawn(StatsProxy::listen());
tokio::spawn(e3_proxy.listen());

tokio::spawn(Orchestration::start_enclave());
tokio::spawn(StatsProxy::listen());

tokio::spawn(HealthCheckServer::start());

tokio::spawn(async move {
if let Err(e) = config_server.listen().await {
log::error!("Error running config server on host: {e:?}");
}
});
tokio::spawn(HealthCheckServer::start());

tokio::spawn(acme_proxy.listen());
tokio::spawn(provisioner_proxy.listen());

let (provisioner_proxy_result,) = tokio::join!(provisioner_proxy.listen(),);
tokio::spawn(acme_proxy.listen());

if let Err(err) = provisioner_proxy_result {
log::error!("Error running provisioner proxy on host: {err:?}");
tokio::spawn(async move {
if let Err(e) = config_server.listen().await {
log::error!("Error starting config server - {e:?}");
}
}
});

#[cfg(feature = "network_egress")]
{
listen_for_shutdown_signal();
let parsed_ip = control_plane::dnsproxy::read_dns_server_ips_from_env_var()
.unwrap_or_else(|| control_plane::dnsproxy::DNS_SERVERS.clone());

let dns_proxy_server = control_plane::dnsproxy::DnsProxy::new(parsed_ip);

tokio::spawn(HealthCheckServer::start());

tokio::spawn(dns_proxy_server.listen());
tokio::spawn(control_plane::egressproxy::EgressProxy::listen());

tokio::spawn(e3_proxy.listen());

tokio::spawn(tcp_server());

tokio::spawn(StatsProxy::listen());

tokio::spawn(Orchestration::start_enclave());

tokio::spawn(HealthCheckServer::start());

tokio::spawn(async move {
if let Err(e) = config_server.listen().await {
log::error!("Error running config server on host: {e:?}");
}
});

tokio::spawn(acme_proxy.listen());

let (provisioner_proxy_result,) = tokio::join!(provisioner_proxy.listen(),);

if let Err(err) = provisioner_proxy_result {
log::error!("Error running provisioner proxy on host: {err:?}");
}
}

Ok(())
tokio::spawn(Orchestration::start_enclave());

tcp_server().await
}

async fn tcp_server() -> Result<()> {
Expand Down

0 comments on commit 533b292

Please sign in to comment.