Unverified Commit 72b9f7b3 authored by Vasili Novikov's avatar Vasili Novikov
Browse files

Use "bridge" docker network by default

parent 4e929721
Showing with 6 additions and 9 deletions
+6 -9
......@@ -61,17 +61,18 @@ pub struct CliOptions {
pub plugins_public_domain: Option<String>,
/// Docker network to use when running plugins, e.g. `docker run --network=XXX ...`
/// If not set, "host" will be used, which means that started plugins
/// If not set, "bridge" will be used, which means that started plugins
/// will share the network with the host system.
/// If Pod itself is running inside docker, please run both Pod and plugins
/// in identical network that will then not be shared with the host system
/// (this is covered in docker-compose.yml by default).
#[structopt(
long,
default_value = "bridge",
name = "PLUGINS_DOCKER_NETWORK",
env = "POD_PLUGINS_DOCKER_NETWORK"
env = "POD_PLUGINS_DOCKER_NETWORK",
)]
pub plugins_docker_network: Option<String>,
pub plugins_docker_network: String,
/// File to read https public certificate from.
#[structopt(
......@@ -186,7 +187,7 @@ pub mod tests {
use_kubernetes: false,
plugins_callback_address: None,
plugins_public_domain: None,
plugins_docker_network: None,
plugins_docker_network: "bridge".to_string(),
insecure_plugin_script: Vec::new(),
tls_pub_crt: "".to_string(),
tls_priv_key: "".to_string(),
......
......@@ -122,10 +122,6 @@ fn run_docker_container(
triggered_by_item_id: &str,
cli_options: &CliOptions,
) -> Result<()> {
let docker_network = match &cli_options.plugins_docker_network {
Some(net) => net.to_string(),
None => "host".to_string(),
};
let container_id = format!(
"{}-{}-{}",
pod_owner
......@@ -151,7 +147,7 @@ fn run_docker_container(
};
let args: Vec<String> = vec![
"run".to_string(),
format!("--network={}", docker_network),
format!("--network={}", cli_options.plugins_docker_network),
format!(
"--env=POD_FULL_ADDRESS={}",
callback_address(cli_options, true)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment