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/04/27 01:37:50 UTC

[1/2] mesos git commit: Fixed docker uri fetcher strict v2 schema 1 check.

Repository: mesos
Updated Branches:
  refs/heads/1.2.x 9e90ae535 -> 4cb0bb4b4


Fixed docker uri fetcher strict v2 schema 1 check.

This check was introduced from this patch:
https://reviews.apache.org/r/53848/

The check on registry v2 schema 1 is incorrect. It does not work
for registries that are older version < 2.3, because the ContentType
header may be something like this "application/json; charset=utf-8".
The check missed a note from docker registry spec that
"application/json" will also be accepted for schema 1.

Depending on the docker registry spec doc, docker support the
following three media type for V2 schema 1 manifest:
  1. application/vnd.docker.distribution.manifest.v1+json
  2. application/vnd.docker.distribution.manifest.v1+prettyjws
  3. application/json
For more details, see:
  https://docs.docker.com/registry/spec/manifest-v2-1/

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


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

Branch: refs/heads/1.2.x
Commit: bf47f1f8a7fd02e16b2431f97827d793952c81ca
Parents: 9e90ae5
Author: Gilbert Song <so...@gmail.com>
Authored: Wed Apr 26 18:25:08 2017 -0700
Committer: Jie Yu <yu...@gmail.com>
Committed: Wed Apr 26 18:30:58 2017 -0700

----------------------------------------------------------------------
 src/uri/fetchers/docker.cpp | 23 ++++++++++++++++++-----
 1 file changed, 18 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/bf47f1f8/src/uri/fetchers/docker.cpp
----------------------------------------------------------------------
diff --git a/src/uri/fetchers/docker.cpp b/src/uri/fetchers/docker.cpp
index ec79b6b..35e9afa 100644
--- a/src/uri/fetchers/docker.cpp
+++ b/src/uri/fetchers/docker.cpp
@@ -521,12 +521,25 @@ Future<Nothing> DockerFetcherPluginProcess::__fetch(
   // digests for pulling images that were pushed with Docker 1.10+ to
   // Registry 2.3+.
   Option<string> contentType = response.headers.get("Content-Type");
-  if (contentType.isSome() &&
-      !strings::startsWith(
+  if (contentType.isSome()) {
+    // NOTE: Docker support the following three media type for V2
+    // schema 1 manifest:
+    // 1. application/vnd.docker.distribution.manifest.v1+json
+    // 2. application/vnd.docker.distribution.manifest.v1+prettyjws
+    // 3. application/json
+    // For more details, see:
+    // https://docs.docker.com/registry/spec/manifest-v2-1/
+    bool isV2Schema1 =
+      strings::startsWith(
           contentType.get(),
-          "application/vnd.docker.distribution.manifest.v1")) {
-    return Failure(
-        "Unsupported manifest MIME type: " + contentType.get());
+          "application/vnd.docker.distribution.manifest.v1") ||
+      strings::startsWith(
+          contentType.get(),
+          "application/json");
+
+    if (!isV2Schema1) {
+      return Failure("Unsupported manifest MIME type: " + contentType.get());
+    }
   }
 
   Try<spec::v2::ImageManifest> manifest = spec::v2::parse(response.body);


[2/2] mesos git commit: Added MESOS-7272 to 1.2.1 CHANGELOG.

Posted by ji...@apache.org.
Added MESOS-7272 to 1.2.1 CHANGELOG.


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

Branch: refs/heads/1.2.x
Commit: 4cb0bb4b4467f32dab7e8a51b3d26c493fef8b54
Parents: bf47f1f
Author: Jie Yu <yu...@gmail.com>
Authored: Wed Apr 26 18:37:35 2017 -0700
Committer: Jie Yu <yu...@gmail.com>
Committed: Wed Apr 26 18:37:35 2017 -0700

----------------------------------------------------------------------
 CHANGELOG | 1 +
 1 file changed, 1 insertion(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/4cb0bb4b/CHANGELOG
----------------------------------------------------------------------
diff --git a/CHANGELOG b/CHANGELOG
index c15a738..99deda5 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -15,6 +15,7 @@ All Issues:
   * [MESOS-7263] - User supplied task environment variables cause warnings in sandbox stdout.
   * [MESOS-7264] - Possibly duplicate environment variables should not leak values to the sandbox.
   * [MESOS-7265] - Containerizer startup may cause sensitive data to leak into sandbox logs.
+  * [MESOS-7272] - Unified containerizer does not support docker registry version < 2.3.
   * [MESOS-7366] - Agent sandbox gc could accidentally delete the entire persistent volume content.
   * [MESOS-7383] - Docker executor logs possibly sensitive parameters.
   * [MESOS-7350] - Failed to pull image from Nexus Registry due to signature missing.