You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by bm...@apache.org on 2016/10/06 02:01:00 UTC
[3/4] mesos git commit: Store the user in the Executor struct in
agent.
Store the user in the Executor struct in agent.
This was split out from https://reviews.apache.org/r/52569/.
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/797d722c
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/797d722c
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/797d722c
Branch: refs/heads/master
Commit: 797d722c0e469d3039d1320ba0acc8348bf5030a
Parents: 0ce6361
Author: Benjamin Mahler <bm...@apache.org>
Authored: Wed Oct 5 18:39:30 2016 -0700
Committer: Benjamin Mahler <bm...@apache.org>
Committed: Wed Oct 5 18:39:39 2016 -0700
----------------------------------------------------------------------
src/slave/slave.cpp | 18 ++++++++++++++++--
src/slave/slave.hpp | 6 ++++++
2 files changed, 22 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/797d722c/src/slave/slave.cpp
----------------------------------------------------------------------
diff --git a/src/slave/slave.cpp b/src/slave/slave.cpp
index fba0895..d30001b 100644
--- a/src/slave/slave.cpp
+++ b/src/slave/slave.cpp
@@ -6131,7 +6131,13 @@ Executor* Framework::launchExecutor(
user);
Executor* executor = new Executor(
- slave, id(), executorInfo, containerId, directory, info.checkpoint());
+ slave,
+ id(),
+ executorInfo,
+ containerId,
+ directory,
+ user,
+ info.checkpoint());
if (executor->checkpoint) {
executor->checkpointExecutor();
@@ -6346,7 +6352,13 @@ void Framework::recoverExecutor(const ExecutorState& state)
slave->flags.work_dir, slave->info.id(), id(), state.id, latest);
Executor* executor = new Executor(
- slave, id(), state.info.get(), latest, directory, info.checkpoint());
+ slave,
+ id(),
+ state.info.get(),
+ latest,
+ directory,
+ info.user(),
+ info.checkpoint());
// Recover the libprocess PID if possible for PID based executors.
if (run.get().http.isSome()) {
@@ -6443,6 +6455,7 @@ Executor::Executor(
const ExecutorInfo& _info,
const ContainerID& _containerId,
const string& _directory,
+ const Option<string>& _user,
bool _checkpoint)
: state(REGISTERING),
slave(_slave),
@@ -6451,6 +6464,7 @@ Executor::Executor(
frameworkId(_frameworkId),
containerId(_containerId),
directory(_directory),
+ user(_user),
checkpoint(_checkpoint),
http(None()),
pid(None()),
http://git-wip-us.apache.org/repos/asf/mesos/blob/797d722c/src/slave/slave.hpp
----------------------------------------------------------------------
diff --git a/src/slave/slave.hpp b/src/slave/slave.hpp
index 9beefa1..e7a6e2c 100644
--- a/src/slave/slave.hpp
+++ b/src/slave/slave.hpp
@@ -828,6 +828,7 @@ struct Executor
const ExecutorInfo& info,
const ContainerID& containerId,
const std::string& directory,
+ const Option<std::string>& user,
bool checkpoint);
~Executor();
@@ -909,6 +910,11 @@ struct Executor
const std::string directory;
+ // The sandbox will be owned by this user and the executor will
+ // run as this user. This can be set to None when --switch_user
+ // is false or when compiled for Windows.
+ const Option<std::string> user;
+
const bool checkpoint;
// An Executor can either be connected via HTTP or by libprocess