MCPcopy Create free account
hub / github.com/dtormoen/tsk-tsk / ensure_network

Method ensure_network

src/docker/proxy_manager.rs:537–550  ·  view source on GitHub ↗

Ensures the specified external network exists for proxy internet access.

(&self, network_name: &str)

Source from the content-addressed store, hash-verified

535
536 /// Ensures the specified external network exists for proxy internet access.
537 async fn ensure_network(&self, network_name: &str) -> Result<()> {
538 if !self
539 .docker_client
540 .network_exists(network_name)
541 .await
542 .map_err(|e| anyhow::anyhow!("Failed to check if network exists: {e}"))?
543 {
544 self.docker_client
545 .create_network(network_name)
546 .await
547 .map_err(|e| anyhow::anyhow!("Failed to create network: {e}"))?;
548 }
549 Ok(())
550 }
551
552 /// Ensures the proxy container for the given config is running.
553 ///

Callers 1

ensure_proxyMethod · 0.80

Calls 2

network_existsMethod · 0.45
create_networkMethod · 0.45

Tested by

no test coverage detected