Skip to content
GitLab
Explore
Projects
Groups
Snippets
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
wajahat Ch
Pod
Commits
72b9f7b3
Unverified
Commit
72b9f7b3
authored
3 years ago
by
Vasili Novikov
Browse files
Options
Download
Email Patches
Plain Diff
Use "bridge" docker network by default
parent
4e929721
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/command_line_interface.rs
+5
-4
src/command_line_interface.rs
src/plugin_run.rs
+1
-5
src/plugin_run.rs
with
6 additions
and
9 deletions
+6
-9
src/command_line_interface.rs
+
5
-
4
View file @
72b9f7b3
...
...
@@ -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
(),
...
...
This diff is collapsed.
Click to expand it.
src/plugin_run.rs
+
1
-
5
View file @
72b9f7b3
...
...
@@ -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
)
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Snippets