Minor cleanup when creating Docker containers. Review: https://reviews.apache.org/r/26616
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/e6fb81c6 Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/e6fb81c6 Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/e6fb81c6 Branch: refs/heads/master Commit: e6fb81c69a82bbdecf67d1800955f409be018c22 Parents: 9ce1fc5 Author: Benjamin Hindman <[email protected]> Authored: Sat Oct 11 14:44:31 2014 -0700 Committer: Benjamin Hindman <[email protected]> Committed: Fri Oct 31 15:05:39 2014 -0700 ---------------------------------------------------------------------- src/slave/containerizer/docker.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/mesos/blob/e6fb81c6/src/slave/containerizer/docker.cpp ---------------------------------------------------------------------- diff --git a/src/slave/containerizer/docker.cpp b/src/slave/containerizer/docker.cpp index 73e3c40..4bf5be4 100644 --- a/src/slave/containerizer/docker.cpp +++ b/src/slave/containerizer/docker.cpp @@ -234,7 +234,14 @@ private: slaveId(slaveId), slavePid(slavePid), checkpoint(checkpoint), - flags(flags) {} + flags(flags) + { + if (task.isSome()) { + resources = task.get().resources(); + } else { + resources = executor.resources(); + } + } std::string name() { @@ -993,10 +1000,6 @@ Future<bool> DockerContainerizerProcess::___launch( return Failure("Failed to synchronize with child process: " + error); } - // Store the resources for usage(). - CHECK_SOME(container->task); - container->resources = container->task.get().resources(); - // And finally watch for when the executor gets reaped. container->status.set(process::reap(s.get().pid())); @@ -1102,9 +1105,6 @@ Future<bool> DockerContainerizerProcess::_____launch( "Failed to checkpoint executor's pid: " + checkpointed.error()); } - // Store the resources for usage(). - containers_[containerId]->resources = containers_[containerId]->executor.resources(); - // And finally watch for when the container gets reaped. containers_[containerId]->status.set(process::reap(pid.get()));
