You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by tn...@apache.org on 2015/10/09 01:14:14 UTC

[1/3] mesos git commit: Fixed minor style issues in Docker Store.

Repository: mesos
Updated Branches:
  refs/heads/master 0981bb004 -> b74ed177d


Fixed minor style issues in Docker Store.

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


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

Branch: refs/heads/master
Commit: b74ed177de4142b52c70d3d198a3c21ce5c214ba
Parents: d8a9ee2
Author: Jojy Varghese <jo...@mesosphere.io>
Authored: Thu Oct 8 22:29:38 2015 +0000
Committer: Timothy Chen <tn...@gmail.com>
Committed: Thu Oct 8 23:13:59 2015 +0000

----------------------------------------------------------------------
 src/slave/containerizer/provisioner/docker/store.cpp | 2 ++
 1 file changed, 2 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/b74ed177/src/slave/containerizer/provisioner/docker/store.cpp
----------------------------------------------------------------------
diff --git a/src/slave/containerizer/provisioner/docker/store.cpp b/src/slave/containerizer/provisioner/docker/store.cpp
index cbb6768..637c97c 100644
--- a/src/slave/containerizer/provisioner/docker/store.cpp
+++ b/src/slave/containerizer/provisioner/docker/store.cpp
@@ -107,6 +107,7 @@ Try<Owned<slave::Store>> Store::create(const Flags& flags)
   if (!os::exists(paths::getStagingDir(flags.docker_store_dir))) {
     Try<Nothing> mkdir =
       os::mkdir(paths::getStagingDir(flags.docker_store_dir));
+
     if (mkdir.isError()) {
       return Error("Failed to create Docker store staging directory: " +
                    mkdir.error());
@@ -177,6 +178,7 @@ Future<Image> StoreProcess::_get(
 
   Try<string> staging =
     os::mkdtemp(paths::getStagingTempDir(flags.docker_store_dir));
+
   if (staging.isError()) {
     return Failure("Failed to create a staging directory");
   }


[3/3] mesos git commit: Fixed log message when untarring local image.

Posted by tn...@apache.org.
Fixed log message when untarring local image.

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


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

Branch: refs/heads/master
Commit: 0a8877ccf58d2e08056e9d21079d3949528df672
Parents: 0981bb0
Author: Jojy Varghese <jo...@mesosphere.io>
Authored: Thu Oct 8 18:46:41 2015 +0000
Committer: Timothy Chen <tn...@gmail.com>
Committed: Thu Oct 8 23:13:59 2015 +0000

----------------------------------------------------------------------
 src/slave/containerizer/provisioner/docker/local_puller.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/0a8877cc/src/slave/containerizer/provisioner/docker/local_puller.cpp
----------------------------------------------------------------------
diff --git a/src/slave/containerizer/provisioner/docker/local_puller.cpp b/src/slave/containerizer/provisioner/docker/local_puller.cpp
index 4a0b7d1..453e572 100644
--- a/src/slave/containerizer/provisioner/docker/local_puller.cpp
+++ b/src/slave/containerizer/provisioner/docker/local_puller.cpp
@@ -124,8 +124,8 @@ Future<Nothing> LocalPullerProcess::untarImage(
     const string& tarPath,
     const string& directory)
 {
-  VLOG(1) << "Untarring image from '" << directory
-          << "' to '" << tarPath << "'";
+  VLOG(1) << "Untarring image from '" << tarPath
+          << "' to '" << directory << "'";
 
   // Untar store_discovery_local_dir/name.tar into directory/.
   // TODO(tnachen): Terminate tar process when slave exits.


[2/3] mesos git commit: Fixed minor style issues in Docker local puller.

Posted by tn...@apache.org.
Fixed minor style issues in Docker local puller.

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


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

Branch: refs/heads/master
Commit: d8a9ee2b56a387affb7a670f8f0da0272903d8f4
Parents: 0a8877c
Author: Jojy Varghese <jo...@mesosphere.io>
Authored: Thu Oct 8 22:25:19 2015 +0000
Committer: Timothy Chen <tn...@gmail.com>
Committed: Thu Oct 8 23:13:59 2015 +0000

----------------------------------------------------------------------
 .../provisioner/docker/local_puller.cpp           | 18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/d8a9ee2b/src/slave/containerizer/provisioner/docker/local_puller.cpp
----------------------------------------------------------------------
diff --git a/src/slave/containerizer/provisioner/docker/local_puller.cpp b/src/slave/containerizer/provisioner/docker/local_puller.cpp
index 453e572..74d0e1e 100644
--- a/src/slave/containerizer/provisioner/docker/local_puller.cpp
+++ b/src/slave/containerizer/provisioner/docker/local_puller.cpp
@@ -106,7 +106,7 @@ Future<list<pair<string, string>>> LocalPullerProcess::pull(
     const Image::Name& name,
     const string& directory)
 {
-  string tarPath = paths::getImageArchiveTarPath(
+  const string tarPath = paths::getImageArchiveTarPath(
       flags.docker_local_archives_dir,
       stringify(name));
 
@@ -129,7 +129,7 @@ Future<Nothing> LocalPullerProcess::untarImage(
 
   // Untar store_discovery_local_dir/name.tar into directory/.
   // TODO(tnachen): Terminate tar process when slave exits.
-  vector<string> argv = {
+  const vector<string> argv = {
     "tar",
     "-C",
     directory,
@@ -171,6 +171,7 @@ static Result<string> getParentId(
 {
   Try<string> manifest =
     os::read(paths::getImageArchiveLayerManifestPath(directory, layerId));
+
   if (manifest.isError()) {
     return Error("Failed to read manifest: " + manifest.error());
   }
@@ -186,6 +187,7 @@ static Result<string> getParentId(
   } else if (parentId.isError()) {
     return Error("Failed to read parent of layer: " + parentId.error());
   }
+
   return parentId.get().value;
 }
 
@@ -196,6 +198,7 @@ Future<list<pair<string, string>>> LocalPullerProcess::putImage(
 {
   Try<string> value =
     os::read(paths::getImageArchiveRepositoriesPath(directory));
+
   if (value.isError()) {
     return Failure("Failed to read repository JSON: " + value.error());
   }
@@ -207,27 +210,30 @@ Future<list<pair<string, string>>> LocalPullerProcess::putImage(
 
   Result<JSON::Object> repositoryValue =
     json.get().find<JSON::Object>(name.repository());
+
   if (repositoryValue.isError()) {
     return Failure("Failed to find repository: " + repositoryValue.error());
   } else if (repositoryValue.isNone()) {
     return Failure("Repository '" + name.repository() + "' is not found");
   }
 
-  JSON::Object repositoryJson = repositoryValue.get();
+  const JSON::Object repositoryJson = repositoryValue.get();
 
   // We don't use JSON find here because a tag might contain a '.'.
   std::map<string, JSON::Value>::const_iterator entry =
     repositoryJson.values.find(name.tag());
+
   if (entry == repositoryJson.values.end()) {
     return Failure("Tag '" + name.tag() + "' is not found");
   } else if (!entry->second.is<JSON::String>()) {
     return Failure("Tag JSON value expected to be JSON::String");
   }
 
-  string layerId = entry->second.as<JSON::String>().value;
+  const string layerId = entry->second.as<JSON::String>().value;
 
   Try<string> manifest =
     os::read(paths::getImageArchiveLayerManifestPath(directory, layerId));
+
   if (manifest.isError()) {
     return Failure("Failed to read manifest: " + manifest.error());
   }
@@ -276,7 +282,7 @@ Future<pair<string, string>> LocalPullerProcess::putLayer(
   // store to make sure we don't end up with partially untarred layer
   // rootfs.
 
-  string localRootfsPath =
+  const string localRootfsPath =
     paths::getImageArchiveLayerRootfsPath(directory, layerId);
 
   // Image layer has been untarred but is not present in the store directory.
@@ -301,7 +307,7 @@ Future<pair<string, string>> LocalPullerProcess::putLayer(
   // Untar directory/id/layer.tar into directory/id/rootfs.
   // The tar file will be removed when the staging directory is
   // removed.
-  vector<string> argv = {
+  const vector<string> argv = {
     "tar",
     "-C",
     localRootfsPath,