Repository: mesos Updated Branches: refs/heads/master 26824f81a -> fa44b0a9f
Include changes to isolation flag when creating Mesos containerizer. Project: http://git-wip-us.apache.org/repos/asf/mesos/repo Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/2b8ad0b9 Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/2b8ad0b9 Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/2b8ad0b9 Branch: refs/heads/master Commit: 2b8ad0b9f69f3393df4a036a232103aea5cd61f9 Parents: 26824f8 Author: Ian Downes <[email protected]> Authored: Wed Oct 22 16:51:05 2014 -0700 Committer: Ian Downes <[email protected]> Committed: Tue Oct 28 11:30:28 2014 -0700 ---------------------------------------------------------------------- src/slave/containerizer/mesos/containerizer.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/mesos/blob/2b8ad0b9/src/slave/containerizer/mesos/containerizer.cpp ---------------------------------------------------------------------- diff --git a/src/slave/containerizer/mesos/containerizer.cpp b/src/slave/containerizer/mesos/containerizer.cpp index 3fa249f..76e0712 100644 --- a/src/slave/containerizer/mesos/containerizer.cpp +++ b/src/slave/containerizer/mesos/containerizer.cpp @@ -92,6 +92,10 @@ Try<MesosContainerizer*> MesosContainerizer::create( isolation = flags.isolation; } + // Modify the flags to include any changes to isolation. + Flags flags_ = flags; + flags_.isolation = isolation; + LOG(INFO) << "Using isolation: " << isolation; // Create a MesosContainerizerProcess using isolators and a launcher. @@ -113,7 +117,7 @@ Try<MesosContainerizer*> MesosContainerizer::create( foreach (const string& type, strings::split(isolation, ",")) { if (creators.contains(type)) { - Try<Isolator*> isolator = creators[type](flags); + Try<Isolator*> isolator = creators[type](flags_); if (isolator.isError()) { return Error( "Could not create isolator " + type + ": " + isolator.error()); @@ -145,10 +149,10 @@ Try<MesosContainerizer*> MesosContainerizer::create( (strings::contains(isolation, "cgroups") || strings::contains(isolation, "network/port_mapping") || strings::contains(isolation, "filesystem/shared")) - ? LinuxLauncher::create(flags) - : PosixLauncher::create(flags); + ? LinuxLauncher::create(flags_) + : PosixLauncher::create(flags_); #else - Try<Launcher*> launcher = PosixLauncher::create(flags); + Try<Launcher*> launcher = PosixLauncher::create(flags_); #endif // __linux__ if (launcher.isError()) { @@ -156,7 +160,7 @@ Try<MesosContainerizer*> MesosContainerizer::create( } return new MesosContainerizer( - flags, local, Owned<Launcher>(launcher.get()), isolators); + flags_, local, Owned<Launcher>(launcher.get()), isolators); }
