You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by ti...@apache.org on 2016/06/16 19:42:24 UTC

[2/4] mesos git commit: Added 'labels' and 'discovery' to derived ExecutorInfo.

Added 'labels' and 'discovery' to derived ExecutorInfo.

If a task uses a CommandExecutor Mesos generates a special
ExecutorInfo inside the agent. As these fields might be relevant
to authorization it now receives Labels and DiscoveryInfo from
the source TaskInfo.

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


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

Branch: refs/heads/master
Commit: dce084594d7c8a76fd02b8803b4f46087d669744
Parents: c8d6759
Author: Joerg Schad <jo...@mesosphere.io>
Authored: Thu Jun 16 20:03:22 2016 +0200
Committer: Till Toenshoff <to...@me.com>
Committed: Thu Jun 16 21:24:46 2016 +0200

----------------------------------------------------------------------
 src/slave/slave.cpp | 11 +++++++++++
 1 file changed, 11 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/dce08459/src/slave/slave.cpp
----------------------------------------------------------------------
diff --git a/src/slave/slave.cpp b/src/slave/slave.cpp
index 27a206f..f46fc01 100644
--- a/src/slave/slave.cpp
+++ b/src/slave/slave.cpp
@@ -3913,6 +3913,17 @@ ExecutorInfo Slave::getExecutorInfo(
           task.command().environment());
     }
 
+    // Add fields which can be relevant (depending on Authorizer) for
+    // authorization.
+
+    if (task.has_labels()) {
+      executor.mutable_labels()->MergeFrom(task.labels());
+    }
+
+    if (task.has_discovery()) {
+      executor.mutable_discovery()->MergeFrom(task.discovery());
+    }
+
     // Adjust the executor shutdown grace period if the kill policy is
     // set. We add a small buffer of time to avoid destroying the
     // container before `TASK_KILLED` is sent by the executor.