Project

Profile

Help

Test #4535

closed

Pulp Crane not returning correct headers

Added by bherring over 5 years ago. Updated over 5 years ago.

Status:
CLOSED - COMPLETE
Priority:
High
Assignee:
Platform Release:
Tags:
Pulp 2
Sprint:
Quarter:

Description

Sync the following docker repo
feed: https://quay.io/
upstream_name: openshift-release-dev/ocp-release

Pulp Crane

Check out the following output when syncing v1 content

$ curl --head -L https://<fqdn>:5000/v2/default_organization-custom-ocp/manifests/4.0.0-0
HTTP/1.1 302 FOUND
Date: Mon, 04 Feb 2019 16:29:14 GMT
Server: Apache/2.4.6 (Red Hat Enterprise Linux)
Content-Length: 437
Location: https://<fqdn>/pulp/docker/v2/fe117c3c-5820-4406-ad34-8404062b8458/manifests/1/4.0.0-0
Content-Type: text/html; charset=utf-8

HTTP/1.1 200 OK
Date: Mon, 04 Feb 2019 16:29:15 GMT
Server: Apache/2.4.6 (Red Hat Enterprise Linux)
Last-Modified: Wed, 30 Jan 2019 16:28:40 GMT
ETag: "e5e-580af6711a0c7"
Accept-Ranges: bytes
Content-Length: 3678
Docker-Distribution-API-Version: registry/2.0

Quay:
Now compare it to the same in quay

$ curl --head -L https://quay.io/v2/coreos/etcd/manifests/latest
HTTP/2 200
server: nginx/1.14.2
date: Mon, 04 Feb 2019 16:29:41 GMT
content-type: application/vnd.docker.distribution.manifest.v1+prettyjws
content-length: 6655
docker-content-digest: sha256:5b6691b7225a3f77a5a919a81261bbfb31283804418e187f7116a0a9ef65d21d
x-frame-options: DENY
strict-transport-security: max-age=63072000; preload

Notice how content-type is set to application/vnd.docker.distribution.manifest.v1+prettyjws in the case of quay, while its blank for pulp-crane.

This causes issues in clients pulling this information.


Related issues

Copied from Docker Support - Issue #4384: Pulp Crane not returning correct headersCLOSED - CURRENTRELEASEipanova@redhat.comActions
Actions #1

Updated by bherring over 5 years ago

  • Copied from Issue #4384: Pulp Crane not returning correct headers added
Actions #2

Updated by bherring over 5 years ago

  • Priority changed from Low to High
Actions #3

Updated by bherring over 5 years ago

  • Sprint/Milestone set to 2.19.0
Actions #4

Updated by bherring over 5 years ago

  • Sprint/Milestone deleted (2.19.0)
Actions #5

Updated by bherring over 5 years ago

  • Assignee set to bherring
Actions #6

Updated by bherring over 5 years ago

  • Status changed from NEW to ASSIGNED
Actions #7

Updated by bherring over 5 years ago

Notes

Verified in 2.20 and 2.19RC that Content-Type is now populated vs older builds:

2-master, 3/28/2019

[root@rhel76-4535 ~]# curl -k --head -L https://localhost/pulp/docker/v2/a/manifests/1/4.0.0-0 ; pulp-admin status
HTTP/1.1 200 OK
Date: Wed, 27 Mar 2019 19:45:49 GMT
Server: Apache/2.4.6 (Red Hat Enterprise Linux) OpenSSL/1.0.2k-fips mod_wsgi/3.4 Python/2.7.5
Last-Modified: Wed, 27 Mar 2019 19:13:36 GMT
ETag: "e5e-585183c0950ef"
Accept-Ranges: bytes
Content-Length: 3678
Docker-Distribution-API-Version: registry/2.0
Content-Type: application/vnd.docker.distribution.manifest.v1+prettyjws

+----------------------------------------------------------------------+
                          Status of the server
+----------------------------------------------------------------------+

Api Version:           2
Database Connection:   
  Connected: True
Known Workers:         
  _id:            scheduler@rhel76-4535
  _ns:            workers
  Last Heartbeat: 2019-03-27T19:45:46Z
  _id:            resource_manager@rhel76-4535
  _ns:            workers
  Last Heartbeat: 2019-03-27T19:45:48Z
  _id:            reserved_resource_worker-0@rhel76-4535
  _ns:            workers
  Last Heartbeat: 2019-03-27T19:45:48Z
Messaging Connection:  
  Connected: True
Versions:              
  Platform Version: 2.20a1

[root@rhel76-4535 ~]#

2.19RC

[root@rhel76-219rc 1554129581.28]# curl -k --head -L https://localhost/pulp/docker/v2/test/manifests/1/4.0.0-0 | grep -i "Content-Type"; pulp-admin status
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0  3678    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
Content-Type: application/vnd.docker.distribution.manifest.v1+prettyjws
+----------------------------------------------------------------------+
                          Status of the server
+----------------------------------------------------------------------+

Api Version:           2
Database Connection:   
  Connected: True
Known Workers:         
  _id:            scheduler@rhel76-219rc
  _ns:            workers
  Last Heartbeat: 2019-04-01T16:29:47Z
  _id:            resource_manager@rhel76-219rc
  _ns:            workers
  Last Heartbeat: 2019-04-01T16:29:48Z
  _id:            reserved_resource_worker-0@rhel76-219rc
  _ns:            workers
  Last Heartbeat: 2019-04-01T16:29:44Z
Messaging Connection:  
  Connected: True
Versions:              
  Platform Version: 2.19c1

[root@rhel76-219rc 1554129581.28]# 

2.17 Comparison

[root@rhel76-217 ~]# curl -k --head -L https://localhost/pulp/docker/v2/a/manifests/1/4.0.0-0 ; pulp-admin status
HTTP/1.1 200 OK
Date: Thu, 28 Mar 2019 11:43:39 GMT
Server: Apache/2.4.6 (Red Hat Enterprise Linux) OpenSSL/1.0.2k-fips mod_wsgi/3.4 Python/2.7.5
Last-Modified: Thu, 28 Mar 2019 11:41:44 GMT
ETag: "e5e-5852609df8897"
Accept-Ranges: bytes
Content-Length: 3678
Docker-Distribution-API-Version: registry/2.0

+----------------------------------------------------------------------+
                          Status of the server
+----------------------------------------------------------------------+

Api Version:           2
Database Connection:   
  Connected: True
Known Workers:         
  _id:            scheduler@rhel76-217
  _ns:            workers
  Last Heartbeat: 2019-03-28T11:43:37Z
  _id:            resource_manager@rhel76-217
  _ns:            workers
  Last Heartbeat: 2019-03-28T11:43:34Z
  _id:            reserved_resource_worker-0@rhel76-217
  _ns:            workers
  Last Heartbeat: 2019-03-28T11:43:39Z
Messaging Connection:  
  Connected: True
Versions:              
  Platform Version: 2.17.1

[root@rhel76-217 ~]# 
Actions #8

Updated by bherring over 5 years ago

Additional References

https://docs.docker.com/registry/spec/manifest-v2-2/
https://docs.docker.com/registry/spec/manifest-v2-1/
The content-type header type of the manifest returned in pulp 2 it is schema1, schema2 and manifest list specifically https://github.com/pulp/pulp_docker/blob/3.2-release/plugins/etc/httpd/conf.d/pulp_docker.conf

Added by bherring over 5 years ago

Revision 596ba78f | View on GitHub

The Docker v2 was not exposing the correct data for Content-Type.

The lack of information was causing issues with clients pulling information from Crane.

Adding tests using standard DOCKER test libraries to ensure Content-Type for any of the tags returns the appropriate information.

closes #4535

Actions #9

Updated by bherring over 5 years ago

  • Status changed from ASSIGNED to MODIFIED
Actions #11

Updated by bmbouter over 5 years ago

  • Tags Pulp 2 added
Actions #12

Updated by bherring over 5 years ago

  • Status changed from MODIFIED to CLOSED - COMPLETE

Also available in: Atom PDF