From b0b2a12b088e971f8167c81f2f8e466ff0eb1365 Mon Sep 17 00:00:00 2001 From: Victor Vieux Date: Thu, 10 Nov 2016 11:55:39 -0800 Subject: [PATCH] update media_type Signed-off-by: Victor Vieux Upstream-commit: 970b23db2e97e1671c6bf4b57bfe5d1a30e98819 Component: engine --- components/engine/distribution/pull_v2.go | 3 ++- components/engine/docs/reference/api/docker_remote_api.md | 2 +- components/engine/plugin/distribution/pull.go | 3 ++- components/engine/vendor.conf | 2 +- .../docker/distribution/manifest/schema2/manifest.go | 2 +- 5 files changed, 7 insertions(+), 5 deletions(-) diff --git a/components/engine/distribution/pull_v2.go b/components/engine/distribution/pull_v2.go index 723fbfc14a..3a2015a41e 100644 --- a/components/engine/distribution/pull_v2.go +++ b/components/engine/distribution/pull_v2.go @@ -358,7 +358,8 @@ func (p *v2Puller) pullV2Tag(ctx context.Context, ref reference.Named) (tagUpdat } if m, ok := manifest.(*schema2.DeserializedManifest); ok { - if m.Manifest.Config.MediaType == schema2.MediaTypePluginConfig { + if m.Manifest.Config.MediaType == schema2.MediaTypePluginConfig || + m.Manifest.Config.MediaType == "application/vnd.docker.plugin.image.v0+json" { //TODO: remove this v0 before 1.13 GA return false, errMediaTypePlugin } } diff --git a/components/engine/docs/reference/api/docker_remote_api.md b/components/engine/docs/reference/api/docker_remote_api.md index c9f0569743..0c83e3b82c 100644 --- a/components/engine/docs/reference/api/docker_remote_api.md +++ b/components/engine/docs/reference/api/docker_remote_api.md @@ -190,7 +190,7 @@ This section lists each version from latest to oldest. Each listing includes a * `POST /plugins/(plugin name)/set` configure a plugin. * `POST /plugins/(plugin name)/enable` enable a plugin. * `POST /plugins/(plugin name)/disable` disable a plugin. -* `POST /plugins/(plugin name)/push` push a pluging. +* `POST /plugins/(plugin name)/push` push a plugin. * `POST /plugins/create?name=(plugin name)` create a plugin. * `DELETE /plugins/(plugin name)` delete a plugin. diff --git a/components/engine/plugin/distribution/pull.go b/components/engine/plugin/distribution/pull.go index cab0d285c9..5694be0573 100644 --- a/components/engine/plugin/distribution/pull.go +++ b/components/engine/plugin/distribution/pull.go @@ -153,7 +153,8 @@ func Pull(ref reference.Named, rs registry.Service, metaheader http.Header, auth logrus.Debugf("pull.go: error in json.Unmarshal(): %v", err) return nil, err } - if m.Config.MediaType != schema2.MediaTypePluginConfig { + if m.Config.MediaType != schema2.MediaTypePluginConfig && + m.Config.MediaType != "application/vnd.docker.plugin.image.v0+json" { //TODO: remove this v0 before 1.13 GA return nil, ErrUnsupportedMediaType } diff --git a/components/engine/vendor.conf b/components/engine/vendor.conf index b174d8cbf5..0b9374c474 100644 --- a/components/engine/vendor.conf +++ b/components/engine/vendor.conf @@ -44,7 +44,7 @@ github.com/boltdb/bolt fff57c100f4dea1905678da7e90d92429dff2904 github.com/miekg/dns 75e6e86cc601825c5dbcd4e0c209eab180997cd7 # get graph and distribution packages -github.com/docker/distribution fbb70dc3a14ca65cdac3aaf5e5122b03b42f6fbc +github.com/docker/distribution c04791f441f98bcf073353d7317db83663cf3ea2 github.com/vbatts/tar-split v0.10.1 # get go-zfs packages diff --git a/components/engine/vendor/github.com/docker/distribution/manifest/schema2/manifest.go b/components/engine/vendor/github.com/docker/distribution/manifest/schema2/manifest.go index 1a12827098..741998d044 100644 --- a/components/engine/vendor/github.com/docker/distribution/manifest/schema2/manifest.go +++ b/components/engine/vendor/github.com/docker/distribution/manifest/schema2/manifest.go @@ -18,7 +18,7 @@ const ( MediaTypeConfig = "application/vnd.docker.container.image.v1+json" // MediaTypePluginConfig specifies the mediaType for plugin configuration. - MediaTypePluginConfig = "application/vnd.docker.plugin.image.v0+json" + MediaTypePluginConfig = "application/vnd.docker.plugin.v1+json" // MediaTypeLayer is the mediaType used for layers referenced by the // manifest.