mesos-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ji...@apache.org
Subject [2/2] mesos git commit: Supported volume/image isolator to be nested aware.
Date Tue, 27 Sep 2016 04:00:25 GMT
Supported volume/image isolator to be nested aware.

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


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

Branch: refs/heads/master
Commit: de865eb86262247e4a64ff9c12e70cc0bc3dcd3a
Parents: 6653aaa
Author: Gilbert Song <songzihao1990@gmail.com>
Authored: Mon Sep 26 20:53:45 2016 -0700
Committer: Jie Yu <yujie.jay@gmail.com>
Committed: Mon Sep 26 20:53:45 2016 -0700

----------------------------------------------------------------------
 .../containerizer/mesos/isolators/volume/image.cpp  | 16 ++++++++++------
 .../containerizer/mesos/isolators/volume/image.hpp  |  2 ++
 2 files changed, 12 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/de865eb8/src/slave/containerizer/mesos/isolators/volume/image.cpp
----------------------------------------------------------------------
diff --git a/src/slave/containerizer/mesos/isolators/volume/image.cpp b/src/slave/containerizer/mesos/isolators/volume/image.cpp
index c25205b..210e67a 100644
--- a/src/slave/containerizer/mesos/isolators/volume/image.cpp
+++ b/src/slave/containerizer/mesos/isolators/volume/image.cpp
@@ -62,6 +62,12 @@ VolumeImageIsolatorProcess::VolumeImageIsolatorProcess(
 VolumeImageIsolatorProcess::~VolumeImageIsolatorProcess() {}
 
 
+bool VolumeImageIsolatorProcess::supportsNesting()
+{
+  return true;
+}
+
+
 Try<Isolator*> VolumeImageIsolatorProcess::create(
     const Flags& flags,
     const Shared<Provisioner>& provisioner)
@@ -77,21 +83,19 @@ Future<Option<ContainerLaunchInfo>> VolumeImageIsolatorProcess::prepare(
     const ContainerID& containerId,
     const ContainerConfig& containerConfig)
 {
-  const ExecutorInfo& executorInfo = containerConfig.executor_info();
-
-  if (!executorInfo.has_container()) {
+  if (!containerConfig.has_container_info()) {
     return None();
   }
 
-  if (executorInfo.container().type() != ContainerInfo::MESOS) {
+  if (containerConfig.container_info().type() != ContainerInfo::MESOS) {
     return Failure("Can only prepare image volumes for a MESOS container");
   }
 
   vector<string> targets;
   list<Future<ProvisionInfo>> futures;
 
-  for (int i = 0; i < executorInfo.container().volumes_size(); i++) {
-    const Volume& volume = executorInfo.container().volumes(i);
+  for (int i = 0; i < containerConfig.container_info().volumes_size(); i++) {
+    const Volume& volume = containerConfig.container_info().volumes(i);
 
     if (!volume.has_image()) {
       continue;

http://git-wip-us.apache.org/repos/asf/mesos/blob/de865eb8/src/slave/containerizer/mesos/isolators/volume/image.hpp
----------------------------------------------------------------------
diff --git a/src/slave/containerizer/mesos/isolators/volume/image.hpp b/src/slave/containerizer/mesos/isolators/volume/image.hpp
index 6333e9c..8465bb5 100644
--- a/src/slave/containerizer/mesos/isolators/volume/image.hpp
+++ b/src/slave/containerizer/mesos/isolators/volume/image.hpp
@@ -44,6 +44,8 @@ public:
 
   virtual ~VolumeImageIsolatorProcess();
 
+  virtual bool supportsNesting();
+
   virtual process::Future<Option<mesos::slave::ContainerLaunchInfo>> prepare(
       const ContainerID& containerId,
       const mesos::slave::ContainerConfig& containerConfig);


Mime
View raw message