diff options
author | Kamil Trzcinski <ayufan@ayufan.eu> | 2016-06-17 13:24:50 +0200 |
---|---|---|
committer | Kamil Trzcinski <ayufan@ayufan.eu> | 2016-06-17 13:24:50 +0200 |
commit | 04ffd71e53efd38b510eaccf96cbd3ccb51293f6 (patch) | |
tree | 085e8977fcabd3c7c59d98f8d2136082685d446c /lib | |
parent | faee4763f7a166772bb40945f82da4b25a95e7d5 (diff) | |
download | gitlab-ce-04ffd71e53efd38b510eaccf96cbd3ccb51293f6.tar.gz |
Fix regression introduced by https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/4669registry-500-fix
When requesting tags a `application/json` is used.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/container_registry/client.rb | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/container_registry/client.rb b/lib/container_registry/client.rb index e0b3f14d384..b222be0475e 100644 --- a/lib/container_registry/client.rb +++ b/lib/container_registry/client.rb @@ -15,11 +15,13 @@ module ContainerRegistry end def repository_tags(name) - @faraday.get("/v2/#{name}/tags/list").body + response = @faraday.get("/v2/#{name}/tags/list") + response.body if response.success? end def repository_manifest(name, reference) - @faraday.get("/v2/#{name}/manifests/#{reference}").body + response = @faraday.get("/v2/#{name}/manifests/#{reference}") + response.body if response.success? end def repository_tag_digest(name, reference) @@ -34,7 +36,8 @@ module ContainerRegistry def blob(name, digest, type = nil) headers = {} headers['Accept'] = type if type - @faraday.get("/v2/#{name}/blobs/#{digest}", nil, headers).body + response = @faraday.get("/v2/#{name}/blobs/#{digest}", nil, headers) + response.body if response.success? end def delete_blob(name, digest) @@ -47,6 +50,7 @@ module ContainerRegistry conn.request :json conn.headers['Accept'] = MANIFEST_VERSION + conn.response :json, content_type: 'application/json' conn.response :json, content_type: 'application/vnd.docker.distribution.manifest.v1+prettyjws' conn.response :json, content_type: 'application/vnd.docker.distribution.manifest.v1+json' conn.response :json, content_type: 'application/vnd.docker.distribution.manifest.v2+json' |