Skip to content

Commit 0671301

Browse files
authored
Merge pull request #10102 from miminar/registry-catalog
Registry catalog API call
2 parents a224255 + 7334e87 commit 0671301

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

dev_guide/managing_images.adoc

+30
Original file line numberDiff line numberDiff line change
@@ -551,6 +551,36 @@ By default, all service accounts in a project have rights to pull any image in
551551
the same project, and the *builder* service account has rights to push any image
552552
in the same project.
553553

554+
ifdef::openshift-origin,openshift-enterprise,openshift-dedicated,atomic-registry[]
555+
=== Listing repositories
556+
557+
Listing of repositories (or rather ImageStream names) is supported via `/v2/_catalog` endpoint as
558+
documented
559+
link:https://github.com/docker/distribution/blob/master/docs/spec/api.md#listing-repositories[upstream].
560+
The only requirement is that the authenticated user must have `list` rights on the `imagestreams`
561+
in the whole cluster.
562+
563+
Here is one example of granting a permission to list ImageStreams to a user:
564+
565+
----
566+
$ oc adm policy add-cluster-role-to-user registry-viewer user
567+
----
568+
569+
.A CLI example of listing repositories
570+
----
571+
$ oc login -u user
572+
$ curl -v -u unused:$(oc whoami -t) https://<registry_server>:<port>/v2/_catalog?n=100
573+
----
574+
575+
[IMPORTANT]
576+
====
577+
This API call is very expensive for a high number of image streams in the cluster. We strongly
578+
recommend to use
579+
link:https://github.com/docker/distribution/blob/master/docs/spec/api.md#pagination[pagination]
580+
instead of listing all image streams.
581+
====
582+
endif::openshift-origin,openshift-enterprise,openshift-dedicated,atomic-registry[]
583+
554584
ifdef::openshift-origin,openshift-online,openshift-enterprise,openshift-dedicated[]
555585
[[using-image-pull-secrets]]
556586
== Using Image Pull Secrets

0 commit comments

Comments
 (0)