Removed redundant environment for Docker containers.

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


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

Branch: refs/heads/master
Commit: f12a63360b95353db5a3bc937c2219e78bf29011
Parents: fdedd0b
Author: Benjamin Hindman <[email protected]>
Authored: Sat Oct 11 19:12:14 2014 -0700
Committer: Benjamin Hindman <[email protected]>
Committed: Fri Oct 31 15:05:39 2014 -0700

----------------------------------------------------------------------
 src/slave/containerizer/docker.cpp | 30 +++++++++++-------------------
 1 file changed, 11 insertions(+), 19 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/f12a6336/src/slave/containerizer/docker.cpp
----------------------------------------------------------------------
diff --git a/src/slave/containerizer/docker.cpp 
b/src/slave/containerizer/docker.cpp
index 86b5ba9..07502e1 100644
--- a/src/slave/containerizer/docker.cpp
+++ b/src/slave/containerizer/docker.cpp
@@ -283,29 +283,21 @@ private:
       return executor.command();
     }
 
-    // Returns the environment to use when launching the Docker container.
+    // Returns any extra environment varaibles to set when launching
+    // the Docker container (beyond the those found in CommandInfo).
     std::map<std::string, std::string> environment() const
     {
-      if (task.isSome()) {
-       // TODO(benh): Is this really correct!?
-       return std::map<std::string, std::string>();
-      }
-
-      std::map<std::string, std::string> environment = executorEnvironment(
-         executor,
-         directory,
-         slaveId,
-         slavePid,
-         checkpoint,
-         flags.recovery_timeout);
-
-      // Include any environment variables from CommandInfo.
-      foreach (const Environment::Variable& variable,
-              executor.command().environment().variables()) {
-       environment[variable.name()] = variable.value();
+      if (task.isNone()) {
+       return executorEnvironment(
+           executor,
+           directory,
+           slaveId,
+           slavePid,
+           checkpoint,
+           flags.recovery_timeout);
       }
 
-      return environment;
+      return std::map<std::string, std::string>();
     }
 
     // The DockerContainerier needs to be able to properly clean up

Reply via email to