You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by ji...@apache.org on 2017/08/24 04:18:51 UTC

mesos git commit: Added task env overwriting executor env glog print.

Repository: mesos
Updated Branches:
  refs/heads/master 415177238 -> fe03c1d89


Added task env overwriting executor env glog print.

When user assign environment by `CommandInfo` environment, it will
overwrite the same name environment get by before.

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


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

Branch: refs/heads/master
Commit: fe03c1d89a8e17d42bab2d2d93f5fb0842533885
Parents: 4151772
Author: Andy Pang <pa...@huawei.com>
Authored: Wed Aug 23 21:18:24 2017 -0700
Committer: Jie Yu <yu...@gmail.com>
Committed: Wed Aug 23 21:18:24 2017 -0700

----------------------------------------------------------------------
 src/slave/containerizer/docker.cpp | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/fe03c1d8/src/slave/containerizer/docker.cpp
----------------------------------------------------------------------
diff --git a/src/slave/containerizer/docker.cpp b/src/slave/containerizer/docker.cpp
index b84c392..cbcff39 100644
--- a/src/slave/containerizer/docker.cpp
+++ b/src/slave/containerizer/docker.cpp
@@ -1422,7 +1422,18 @@ Future<pid_t> DockerContainerizerProcess::launchExecutorProcess(
   foreach (const Environment::Variable& variable,
            container->containerConfig.executor_info()
              .command().environment().variables()) {
-    environment[variable.name()] = variable.value();
+    const string& name = variable.name();
+    const string& value = variable.value();
+
+    if (environment.count(name)) {
+      VLOG(1) << "Overwriting environment variable '"
+              << name << "', original: '"
+              << environment[name] << "', new: '"
+              << value << "', for container "
+              << container->id;
+    }
+
+    environment[name] = value;
   }
 
   // Pass GLOG flag to the executor.