You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by vi...@apache.org on 2014/08/26 02:19:36 UTC
git commit: Fixed MesosContainerizer to reject tasks that have
ContainerInfo set.
Repository: mesos
Updated Branches:
refs/heads/master e148e52b5 -> d45c79676
Fixed MesosContainerizer to reject tasks that have ContainerInfo set.
Review: https://reviews.apache.org/r/25033
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/d45c7967
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/d45c7967
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/d45c7967
Branch: refs/heads/master
Commit: d45c796765dfb816bfd573631fef274e1b9380d9
Parents: e148e52
Author: Vinod Kone <vi...@gmail.com>
Authored: Mon Aug 25 12:45:42 2014 -0700
Committer: Vinod Kone <vi...@gmail.com>
Committed: Mon Aug 25 17:19:05 2014 -0700
----------------------------------------------------------------------
src/slave/containerizer/mesos/containerizer.cpp | 20 ++++++++++++++------
1 file changed, 14 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/d45c7967/src/slave/containerizer/mesos/containerizer.cpp
----------------------------------------------------------------------
diff --git a/src/slave/containerizer/mesos/containerizer.cpp b/src/slave/containerizer/mesos/containerizer.cpp
index d0676c5..5116b14 100644
--- a/src/slave/containerizer/mesos/containerizer.cpp
+++ b/src/slave/containerizer/mesos/containerizer.cpp
@@ -371,14 +371,16 @@ Future<bool> MesosContainerizerProcess::launch(
return Failure("Container already started");
}
- // TODO(tillt): The slave should expose which containerization
- // mechanisms it supports to avoid scheduling tasks that it cannot
- // run.
+ if (executorInfo.has_container()) {
+ // We return false as this containerizer does not support
+ // handling ContainerInfo.
+ return false;
+ }
+
const CommandInfo& command = executorInfo.command();
if (command.has_container()) {
// We return false as this containerizer does not support
- // handling ContainerInfo. Users have to be made aware of this
- // lack of support to prevent confusion in the task configuration.
+ // handling ContainerInfo.
return false;
}
@@ -412,7 +414,7 @@ Future<bool> MesosContainerizerProcess::launch(
Future<bool> MesosContainerizerProcess::launch(
const ContainerID& containerId,
- const TaskInfo&,
+ const TaskInfo& taskInfo,
const ExecutorInfo& executorInfo,
const string& directory,
const Option<string>& user,
@@ -420,6 +422,12 @@ Future<bool> MesosContainerizerProcess::launch(
const PID<Slave>& slavePid,
bool checkpoint)
{
+ if (taskInfo.has_container()) {
+ // We return false as this containerizer does not support
+ // handling ContainerInfo.
+ return false;
+ }
+
return launch(
containerId,
executorInfo,