summaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorUrvashi Mohnani <umohnani@redhat.com>2018-09-11 16:37:43 -0400
committerAtomic Bot <atomic-devel@projectatomic.io>2018-09-13 16:20:40 +0000
commit70b160ae032b548b3d4456f17f8436b24ea37a15 (patch)
treec9fd9529573742180ca9d582fe68349d04ca96f3 /cmd
parent9bc3c9d11cb112410e963b73a4d0dfe3742d27cf (diff)
downloadpodman-70b160ae032b548b3d4456f17f8436b24ea37a15.tar.gz
podman-70b160ae032b548b3d4456f17f8436b24ea37a15.tar.bz2
podman-70b160ae032b548b3d4456f17f8436b24ea37a15.zip
Search registries with an empty query
Adds functionality to search registries implementing the v2 endpoint with an empty query, that is the results will be all the available images on the registries. If this is tried with a v1 registry an error will occur. To search a whole registry, there needs to be a trailing slash at the end, i.e `podman search registry.fedoraproject.org/`. Signed-off-by: Urvashi Mohnani <umohnani@redhat.com> Closes: #1444 Approved by: rhatdan
Diffstat (limited to 'cmd')
-rw-r--r--cmd/podman/search.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/cmd/podman/search.go b/cmd/podman/search.go
index 009ff8ba9..f64b822fc 100644
--- a/cmd/podman/search.go
+++ b/cmd/podman/search.go
@@ -345,6 +345,11 @@ func matchesOfficialFilter(filter searchFilterParams, result docker.SearchResult
}
func getRegistry(image string) (string, error) {
+ // It is possible to only have the registry name in the format "myregistry/"
+ // if so, just trim the "/" from the end and return the registry name
+ if strings.HasSuffix(image, "/") {
+ return strings.TrimSuffix(image, "/"), nil
+ }
imgRef, err := reference.Parse(image)
if err != nil {
return "", err