summaryrefslogtreecommitdiff
path: root/spec/models
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2019-07-24 21:44:07 -0700
committerStan Hu <stanhu@gmail.com>2019-07-25 04:11:38 -0700
commita40116065e2a761f6fa8dc7d569cb3e39025f6d3 (patch)
tree64d0d2ba3cfdc8f1cbc57c4fa7bc21ae7044a01b /spec/models
parenta5eaefc9027696fc65b7d51251902e013c14d161 (diff)
downloadgitlab-ce-a40116065e2a761f6fa8dc7d569cb3e39025f6d3.tar.gz
Support Docker OCI imagessh-support-docker-oci-images
Docker Distribution v2.7.0 shipped with OCI support, but our container registry client was not updated to handle the manifest format in the HTTP `Accept` header. As a result, API calls to retrieve a manifest would return with an error, "OCI manifest found, but accept header does not support OCI manifests". This would result in blank fields in the container registry page and prevent tags from being deleted. To fix this, we just need to add `application/vnd.oci.image.manifest.v1+json` to the `Accept` header and configure Faraday to parse the response as JSON. The response structure is the same as the standard Docker Distribution V2 manifest. Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/58685 Closes https://gitlab.com/gitlab-org/gitlab-ee/issues/12877
Diffstat (limited to 'spec/models')
-rw-r--r--spec/models/container_repository_spec.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/spec/models/container_repository_spec.rb b/spec/models/container_repository_spec.rb
index 013112d1d51..935838ce294 100644
--- a/spec/models/container_repository_spec.rb
+++ b/spec/models/container_repository_spec.rb
@@ -16,7 +16,7 @@ describe ContainerRepository do
host_port: 'registry.gitlab')
stub_request(:get, 'http://registry.gitlab/v2/group/test/my_image/tags/list')
- .with(headers: { 'Accept' => 'application/vnd.docker.distribution.manifest.v2+json' })
+ .with(headers: { 'Accept' => ContainerRegistry::Client::ACCEPTED_TYPES.join(', ') })
.to_return(
status: 200,
body: JSON.dump(tags: ['test_tag']),