Bug 1475989 - Cant list all images in the OCP internal registry with cluster-admin role.
Summary: Cant list all images in the OCP internal registry with cluster-admin role.
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Image Registry
Version: 3.5.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: ---
Assignee: Michal Fojtik
QA Contact: ge liu
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-07-27 17:39 UTC by Ryan Howe
Modified: 2020-09-10 11:03 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-07-27 18:02:43 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Ryan Howe 2017-07-27 17:39:38 UTC
Description of problem:

Using a tokened user that is bound to the cluster-admin role. I can not list all images in the registry. 


Version-Release number of selected component (if applicable):
openshift3/ose-docker-registry:v3.5


How reproducible:
100%

Steps to Reproduce:
1. Log in as a user that has cluster-admin role bound
2. # curl -k -XGET -H "Authorization: Bearer `oc whoami -t`" -H "Content-Type: application/json" https://172.30.80.65:5000/v2/_catalog -v

Actual results:
HTTP/1.1 400 Bad Request

Expected results:
List of all images. 


Additional info:




Logs from registry 

time="2017-07-27T17:28:07.717979562Z" level=debug msg="authorizing request" go.version=go1.7.6 http.request.contenttype="application/json" http.request.host="172.30.80.65:5000" http.request.id=9184b4f5-b3a1-488d-8e50-94c831d78fa8 http.request.method=GET http.request.remoteaddr="10.131.0.1:55906" http.request.uri="/v2/_catalog" http.request.useragent="curl/7.29.0" instance.id=a0c1e404-40f8-47d8-8a42-fba22e663cac 
time="2017-07-27T17:28:07.718118279Z" level=debug msg="Origin auth: checking for access to registry:catalog:*" go.version=go1.7.6 http.request.contenttype="application/json" http.request.host="172.30.80.65:5000" http.request.id=9184b4f5-b3a1-488d-8e50-94c831d78fa8 http.request.method=GET http.request.remoteaddr="10.131.0.1:55906" http.request.uri="/v2/_catalog" http.request.useragent="curl/7.29.0" instance.id=a0c1e404-40f8-47d8-8a42-fba22e663cac 
time="2017-07-27T17:28:07.718145599Z" level=error msg="error checking authorization: unsupported resource" go.version=go1.7.6 http.request.contenttype="application/json" http.request.host="172.30.80.65:5000" http.request.id=9184b4f5-b3a1-488d-8e50-94c831d78fa8 http.request.method=GET http.request.remoteaddr="10.131.0.1:55906" http.request.uri="/v2/_catalog" http.request.useragent="curl/7.29.0" instance.id=a0c1e404-40f8-47d8-8a42-fba22e663cac 
time="2017-07-27T17:28:07.718167717Z" level=error msg="error authorizing context: unsupported resource" go.version=go1.7.6 http.request.contenttype="application/json" http.request.host="172.30.80.65:5000" http.request.id=9184b4f5-b3a1-488d-8e50-94c831d78fa8 http.request.method=GET http.request.remoteaddr="10.131.0.1:55906" http.request.uri="/v2/_catalog" http.request.useragent="curl/7.29.0" instance.id=a0c1e404-40f8-47d8-8a42-fba22e663cac

Comment 1 Paul Weil 2017-07-27 18:02:43 UTC
The /v2/_catalog endpoint is not implemented in the OpenShift integrated registry.  We are tracking this feature in trello: https://trello.com/c/AZINw5qI/964-8-registry-implement-catalog-api-call 

Please note that the catalog api specification allows a registry to fully control the output of the response so implementation is registry specific: https://docs.docker.com/registry/spec/api/#listing-repositories.

An alternative here would be listing the imagestreams or, if you're trying to search, oc new-app --search may be an option:

--search=false: Search all templates, image streams, and Docker images that match the arguments provided.


Note You need to log in before you can comment on or make changes to this bug.