Removed redundant 'root' user set in containerizer::launch(). The 'user' in launch command is ignored, so it is not necessary to explicitly set 'root' user to 'CommandInfo' in the case of command task.
Review: https://reviews.apache.org/r/57401/ Project: http://git-wip-us.apache.org/repos/asf/mesos/repo Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/e2f46f1c Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/e2f46f1c Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/e2f46f1c Branch: refs/heads/master Commit: e2f46f1c5e0fda4c2bf152a5ccb904f6d1af4b09 Parents: de89ac8 Author: Gilbert Song <[email protected]> Authored: Thu Mar 9 12:42:40 2017 -0800 Committer: Jie Yu <[email protected]> Committed: Thu Mar 9 13:43:59 2017 -0800 ---------------------------------------------------------------------- src/slave/containerizer/mesos/containerizer.cpp | 7 ------- 1 file changed, 7 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/mesos/blob/e2f46f1c/src/slave/containerizer/mesos/containerizer.cpp ---------------------------------------------------------------------- diff --git a/src/slave/containerizer/mesos/containerizer.cpp b/src/slave/containerizer/mesos/containerizer.cpp index b001d02..a23a6fa 100644 --- a/src/slave/containerizer/mesos/containerizer.cpp +++ b/src/slave/containerizer/mesos/containerizer.cpp @@ -1011,13 +1011,6 @@ Future<bool> MesosContainerizerProcess::launch( if (taskInfo->has_container()) { ContainerInfo* containerInfo = containerConfig.mutable_container_info(); containerInfo->CopyFrom(taskInfo->container()); - - if (taskInfo->container().mesos().has_image()) { - // For command tasks, we need to set the command executor user - // as root as it needs to perform chroot (even when - // switch_user is set to false). - containerConfig.mutable_command_info()->set_user("root"); - } } } else { // Other cases.
