mesos-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tnac...@apache.org
Subject mesos git commit: Enhanced option for Docker cli volume plugin.
Date Tue, 24 Nov 2015 22:32:41 GMT
Repository: mesos
Updated Branches:
  refs/heads/master 1c1731d11 -> fc7e25d8c


Enhanced option for Docker cli volume plugin.

Enhanced option for Docker cli volume plugin.

Review: https://reviews.apache.org/r/38338


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

Branch: refs/heads/master
Commit: fc7e25d8c05ee3c226e4d45819c047009ddd71c0
Parents: 1c1731d
Author: haosdent huang <haosdent@gmail.com>
Authored: Tue Nov 24 01:24:47 2015 +0000
Committer: Timothy Chen <tnachen@gmail.com>
Committed: Tue Nov 24 22:32:28 2015 +0000

----------------------------------------------------------------------
 include/mesos/mesos.proto |  3 +++
 src/docker/docker.cpp     | 11 +++++++++--
 2 files changed, 12 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/fc7e25d8/include/mesos/mesos.proto
----------------------------------------------------------------------
diff --git a/include/mesos/mesos.proto b/include/mesos/mesos.proto
index 0b8289f..f14fe21 100644
--- a/include/mesos/mesos.proto
+++ b/include/mesos/mesos.proto
@@ -1487,6 +1487,9 @@ message ContainerInfo {
     // pull the docker image from the registry even if the image
     // is already downloaded on the slave.
     optional bool force_pull_image = 6;
+
+    // The name of volume driver plugin.
+    optional string volume_driver = 7;
   }
 
   message MesosInfo {

http://git-wip-us.apache.org/repos/asf/mesos/blob/fc7e25d8/src/docker/docker.cpp
----------------------------------------------------------------------
diff --git a/src/docker/docker.cpp b/src/docker/docker.cpp
index 031f403..5dc4667 100755
--- a/src/docker/docker.cpp
+++ b/src/docker/docker.cpp
@@ -428,13 +428,16 @@ Future<Nothing> Docker::run(
   foreach (const Volume& volume, containerInfo.volumes()) {
     string volumeConfig = volume.container_path();
     if (volume.has_host_path()) {
-      if (!strings::startsWith(volume.host_path(), "/")) {
-        // Support mapping relative paths from the sandbox.
+      if (!strings::startsWith(volume.host_path(), "/") &&
+          !dockerInfo.has_volume_driver()) {
+        // When volume dirver is empty and host path is a relative path, mapping
+        // host path from the sandbox.
         volumeConfig =
           path::join(sandboxDirectory, volume.host_path()) + ":" + volumeConfig;
       } else {
         volumeConfig = volume.host_path() + ":" + volumeConfig;
       }
+
       if (volume.has_mode()) {
         switch (volume.mode()) {
           case Volume::RW: volumeConfig += ":rw"; break;
@@ -454,6 +457,10 @@ Future<Nothing> Docker::run(
   argv.push_back("-v");
   argv.push_back(sandboxDirectory + ":" + mappedDirectory);
 
+  if (dockerInfo.has_volume_driver()) {
+    argv.push_back("--volume-driver=" + dockerInfo.volume_driver());
+  }
+
   const string& image = dockerInfo.image();
 
   argv.push_back("--net");


Mime
View raw message