Update docker uri to expect 3 slashes in prefix

Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/fb270159
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/fb270159
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/fb270159

Branch: refs/heads/master
Commit: fb270159cf409375c76a36a17dba2a0f4ee67382
Parents: c4b98ad
Author: Timothy Chen <[email protected]>
Authored: Thu Jul 10 00:05:24 2014 +0000
Committer: Benjamin Hindman <[email protected]>
Committed: Mon Aug 4 15:08:17 2014 -0700

----------------------------------------------------------------------
 src/examples/docker_no_executor_framework.cpp | 2 +-
 src/slave/containerizer/docker.cpp            | 4 ++--
 src/tests/docker_containerizer_tests.cpp      | 8 ++++----
 3 files changed, 7 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/fb270159/src/examples/docker_no_executor_framework.cpp
----------------------------------------------------------------------
diff --git a/src/examples/docker_no_executor_framework.cpp 
b/src/examples/docker_no_executor_framework.cpp
index 0d59928..3619405 100644
--- a/src/examples/docker_no_executor_framework.cpp
+++ b/src/examples/docker_no_executor_framework.cpp
@@ -104,7 +104,7 @@ public:
         // Use Docker to run the task.
         CommandInfo::ContainerInfo* container =
           task.mutable_command()->mutable_container();
-        container->set_image("docker://busybox");
+        container->set_image("docker:///busybox");
 
         Resource* resource;
 

http://git-wip-us.apache.org/repos/asf/mesos/blob/fb270159/src/slave/containerizer/docker.cpp
----------------------------------------------------------------------
diff --git a/src/slave/containerizer/docker.cpp 
b/src/slave/containerizer/docker.cpp
index 2aceb35..60ac262 100644
--- a/src/slave/containerizer/docker.cpp
+++ b/src/slave/containerizer/docker.cpp
@@ -499,7 +499,7 @@ Future<bool> DockerContainerizerProcess::launch(
 
   // Check if we should try and launch this command.
   if (!command.has_container() ||
-      !strings::startsWith(command.container().image(), "docker")) {
+      !strings::startsWith(command.container().image(), "docker:///")) {
     return false;
   }
 
@@ -518,7 +518,7 @@ Future<bool> DockerContainerizerProcess::launch(
 
   // Extract the Docker image.
   string image = command.container().image();
-  image = strings::remove(image, "docker://", strings::PREFIX);
+  image = strings::remove(image, "docker:///", strings::PREFIX);
 
   // Construct the Docker container name.
   string name = DOCKER_NAME_PREFIX + stringify(containerId);

http://git-wip-us.apache.org/repos/asf/mesos/blob/fb270159/src/tests/docker_containerizer_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/docker_containerizer_tests.cpp 
b/src/tests/docker_containerizer_tests.cpp
index d70518a..2fa18e0 100644
--- a/src/tests/docker_containerizer_tests.cpp
+++ b/src/tests/docker_containerizer_tests.cpp
@@ -167,7 +167,7 @@ TEST_F(DockerContainerizerTest, DOCKER_Launch)
 
   CommandInfo command;
   CommandInfo::ContainerInfo* containerInfo = command.mutable_container();
-  containerInfo->set_image("docker://busybox");
+  containerInfo->set_image("docker:///busybox");
   command.set_value("sleep 120");
 
   task.mutable_command()->CopyFrom(command);
@@ -265,7 +265,7 @@ TEST_F(DockerContainerizerTest, DOCKER_Kill)
 
   CommandInfo command;
   CommandInfo::ContainerInfo* containerInfo = command.mutable_container();
-  containerInfo->set_image("docker://busybox");
+  containerInfo->set_image("docker:///busybox");
   command.set_value("sleep 120");
 
   task.mutable_command()->CopyFrom(command);
@@ -374,7 +374,7 @@ TEST_F(DockerContainerizerTest, DOCKER_Usage)
 
   CommandInfo command;
   CommandInfo::ContainerInfo* containerInfo = command.mutable_container();
-  containerInfo->set_image("docker://busybox");
+  containerInfo->set_image("docker:///busybox");
 
   // Run a CPU intensive command, so we can measure utime and stime later.
   command.set_value("dd if=/dev/zero of=/dev/null");
@@ -493,7 +493,7 @@ TEST_F(DockerContainerizerTest, DOCKER_Update)
 
   CommandInfo command;
   CommandInfo::ContainerInfo* containerInfo = command.mutable_container();
-  containerInfo->set_image("docker://busybox");
+  containerInfo->set_image("docker:///busybox");
   command.set_value("sleep 180");
 
   task.mutable_command()->CopyFrom(command);

Reply via email to