Repository: mesos Updated Branches: refs/heads/master f556d24f3 -> 92a0c16a1
Renamed ManifestResponse to Manifest in the docker registry client. Review: https://reviews.apache.org/r/39014 Project: http://git-wip-us.apache.org/repos/asf/mesos/repo Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/92a0c16a Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/92a0c16a Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/92a0c16a Branch: refs/heads/master Commit: 92a0c16a1518a075ef8c5302b2f9637ff2f2a01a Parents: f556d24 Author: Jojy Varghese <[email protected]> Authored: Fri Oct 30 16:31:03 2015 -0700 Committer: Benjamin Mahler <[email protected]> Committed: Fri Oct 30 16:31:03 2015 -0700 ---------------------------------------------------------------------- .../provisioner/docker/registry_client.cpp | 22 +++++++++----------- .../provisioner/docker/registry_client.hpp | 4 ++-- 2 files changed, 12 insertions(+), 14 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/mesos/blob/92a0c16a/src/slave/containerizer/mesos/provisioner/docker/registry_client.cpp ---------------------------------------------------------------------- diff --git a/src/slave/containerizer/mesos/provisioner/docker/registry_client.cpp b/src/slave/containerizer/mesos/provisioner/docker/registry_client.cpp index c260684..e4d2c22 100644 --- a/src/slave/containerizer/mesos/provisioner/docker/registry_client.cpp +++ b/src/slave/containerizer/mesos/provisioner/docker/registry_client.cpp @@ -74,7 +74,7 @@ public: const URL& authServer, const Option<Credentials>& creds); - Future<ManifestResponse> getManifest( + Future<Manifest> getManifest( const string& path, const Option<string>& tag, const Duration& timeout); @@ -149,7 +149,7 @@ RegistryClient::~RegistryClient() } -Future<ManifestResponse> RegistryClient::getManifest( +Future<Manifest> RegistryClient::getManifest( const string& _path, const Option<string>& _tag, const Option<Duration>& _timeout) @@ -442,7 +442,7 @@ Future<http::Response> RegistryClientProcess::doHttpGet( } -Future<ManifestResponse> RegistryClientProcess::getManifest( +Future<Manifest> RegistryClientProcess::getManifest( const string& path, const Option<string>& tag, const Duration& timeout) @@ -460,8 +460,7 @@ Future<ManifestResponse> RegistryClientProcess::getManifest( manifestURL.path = "v2/" + path + "/manifests/" + repoTag; - auto getManifestResponse = [](const http::Response& httpResponse) - -> Try<ManifestResponse> { + auto getManifest = [](const http::Response& httpResponse) -> Try<Manifest> { if (!httpResponse.headers.contains("Docker-Content-Digest")) { return Error("Docker-Content-Digest header missing in response"); } @@ -563,7 +562,7 @@ Future<ManifestResponse> RegistryClientProcess::getManifest( index++; } - return ManifestResponse { + return Manifest { name.get().value, httpResponse.headers.at("Docker-Content-Digest"), fsLayerInfoList, @@ -571,16 +570,15 @@ Future<ManifestResponse> RegistryClientProcess::getManifest( }; return doHttpGet(manifestURL, None(), timeout, true, None()) - .then([getManifestResponse] (const http::Response& response) - -> Future<ManifestResponse> { - Try<ManifestResponse> manifestResponse = getManifestResponse(response); + .then([getManifest] (const http::Response& response) -> Future<Manifest> { + Try<Manifest> manifest = getManifest(response); - if (manifestResponse.isError()) { + if (manifest.isError()) { return Failure( - "Failed to parse manifest response: " + manifestResponse.error()); + "Failed to parse manifest response: " + manifest.error()); } - return manifestResponse.get(); + return manifest.get(); }); } http://git-wip-us.apache.org/repos/asf/mesos/blob/92a0c16a/src/slave/containerizer/mesos/provisioner/docker/registry_client.hpp ---------------------------------------------------------------------- diff --git a/src/slave/containerizer/mesos/provisioner/docker/registry_client.hpp b/src/slave/containerizer/mesos/provisioner/docker/registry_client.hpp index c47b133..ad57d85 100644 --- a/src/slave/containerizer/mesos/provisioner/docker/registry_client.hpp +++ b/src/slave/containerizer/mesos/provisioner/docker/registry_client.hpp @@ -58,7 +58,7 @@ struct FileSystemLayerInfo * * Reference: https://docs.docker.com/registry/spec/api */ -struct ManifestResponse +struct Manifest { const std::string name; const std::string digest; @@ -105,7 +105,7 @@ public: * @return JSON object on success. * Failure on process failure. */ - process::Future<ManifestResponse> getManifest( + process::Future<Manifest> getManifest( const std::string& path, const Option<std::string>& tag, const Option<Duration>& timeout);
