This is an automated email from the ASF dual-hosted git repository.

bmahler pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mesos.git


The following commit(s) were added to refs/heads/master by this push:
     new 5c3b039db CHANGE: add default network if no net options was set.
5c3b039db is described below

commit 5c3b039db544e937617cd63810185cc95fc2b34b
Author: Andreas Peters <[email protected]>
AuthorDate: Mon May 27 22:33:32 2024 +0200

    CHANGE: add default network if no net options was set.
---
 src/docker/docker.cpp | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/docker/docker.cpp b/src/docker/docker.cpp
index 8ad58339b..50239bf32 100644
--- a/src/docker/docker.cpp
+++ b/src/docker/docker.cpp
@@ -833,12 +833,12 @@ Try<Docker::RunOptions> Docker::RunOptions::create(
   ContainerInfo::DockerInfo::Network network;
   if (dockerInfo.has_network()) {
     network = dockerInfo.network();
-  } else {
-    // If no network was given, then use the OS specific default.
+  } else if (!options.network.isSome()) {
+    // If no network and no docker network options was given, then use the OS 
specific default.    
 #ifdef __WINDOWS__
-    network = ContainerInfo::DockerInfo::BRIDGE;
+      network = ContainerInfo::DockerInfo::BRIDGE;
 #else
-    network = ContainerInfo::DockerInfo::HOST;
+      network = ContainerInfo::DockerInfo::HOST;
 #endif // __WINDOWS__
   }
 

Reply via email to