RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1846629 - [RFE] Enable "podman search" to use wildcard (star) for queries
Summary: [RFE] Enable "podman search" to use wildcard (star) for queries
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: podman
Version: 8.2
Hardware: All
OS: Linux
medium
medium
Target Milestone: rc
: 8.4
Assignee: Valentin Rothberg
QA Contact: Alex Jia
URL:
Whiteboard:
Depends On:
Blocks: 1186913 1823908
TreeView+ depends on / blocked
 
Reported: 2020-06-12 11:04 UTC by Phil Jasbutis
Modified: 2024-06-13 22:42 UTC (History)
15 users (show)

Fixed In Version: podman 2.2 or newer
Doc Type: Enhancement
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-02-16 14:21:45 UTC
Type: Feature Request
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Knowledge Base (Solution) 5153971 0 None None None 2020-06-12 11:06:52 UTC

Description Phil Jasbutis 2020-06-12 11:04:32 UTC
Allowing wildcard (star) in "podman search" (e.g. for registry.redhat.io) is a natural extension to a normal search term.
Using * is a common wildcard in several command sets and should be usable in "podman search" queries.


Red Hat's registries (registry.redhat.io, registry.access.redhat.com) accept wildcard queries:

$ curl -s https://registry.redhat.io/v1/search?q="*" | python2 -mjson.tool | grep "num_results"
    "num_results": 1995

$ curl -s https://registry.redhat.io/v1/search?q=\"*\" | python2 -mjson.tool | grep "num_results"
    "num_results": 1995

$ curl -s https://registry.redhat.io/v1/search?q=* | python2 -mjson.tool | grep "num_results"
    "num_results": 1995

$ curl -s https://registry.access.redhat.com/v1/search?q="*" | python2 -mjson.tool | grep "num_results"
    "num_results": 1145

$ curl -s https://registry.access.redhat.com/v1/search?q=\"*\" | python2 -mjson.tool | grep "num_results"
    "num_results": 1145

$ curl -s https://registry.access.redhat.com/v1/search?q=* | python2 -mjson.tool | grep "num_results"
    "num_results": 1145


This should be also usable by podman search.
At the moment it looks like this:


$ podman search registry.redhat.io/*
Error: error getting registry from "registry.redhat.io/*": invalid reference format

$ podman search registry.access.redhat.com/*
Error: error getting registry from "registry.access.redhat.com/*": invalid reference format

$ podman search registry.redhat.io/\*
Error: error getting registry from "registry.redhat.io/*": invalid reference format

$ podman search registry.redhat.io/\"*\"
Error: error getting registry from "registry.redhat.io/\"*\"": invalid reference format

$ podman search registry.access.redhat.com/
ERRO[0001] error getting search results from v2 endpoint "registry.access.redhat.com": invalid status code from registry 404 (Not Found) 

$ podman search registry.redhat.io/
ERRO[0020] error getting search results from v2 endpoint "registry.redhat.io": invalid status code from registry 404 (Not Found) 



The following queries should lead to a v1 listing of all delivered images from the server
(except there more than 25 results which will be cut off by podman if --limit is not specified)

$ podman search registry.redhat.io/*
$ podman search registry.redhat.io/"*"
$ podman search registry.access.redhat.com/*
$ podman search registry.access.redhat.com/"*"

Comment 7 Phil Jasbutis 2020-06-18 12:04:07 UTC
Hi Valentin,

the request is just about the usage of * as single character after the trailing slash like this

$ podman search registry.redhat.io/*
$ podman search registry.access.redhat.com/*

This is not requested:

$ podman search registry.redhat.io/rh*l
$ podman search registry.access.redhat.com/rh*l

Comment 8 Valentin Rothberg 2020-06-22 08:51:06 UTC
With https://github.com/containers/libpod/commit/b05888a97dbb45a205ff535538ecdd91a19c6ae3 merged upstream, the next release of Podman will support wildcards. In fact, Podman will send any input search term to the registry and lets the registry decide whether it supports the term or not.

Comment 9 Tom Sweeney 2020-06-22 18:51:21 UTC
As this RFE has been addressed with this PR: https://github.com/containers/libpod/pull/6621 and it will be part of the first version of Podman after Podman v2.0.0 (Likely the next version will be v2.0.1), I'm closing this PR as next release.

Comment 21 Alex Jia 2021-01-06 17:27:52 UTC
Verified on podman-2.2.1-2.module+el8.3.1+9107+df0d2892.x86_64 w/
runc-1.0.0-69.rc92.module+el8.3.1+9107+df0d2892.x86_64.


# podman search registry.access.redhat.com/*| grep rhel-tools
redhat.com  registry.access.redhat.com/rhel7/rhel-tools                                 Provides the core systems administrator and ...  0

# podman search registry.redhat.io/*|wc -l
26
# podman search registry.redhat.io/"*"|wc -l
26
# podman search registry.access.redhat.com/*|wc -l
26
# podman search registry.access.redhat.com/"*"|wc -l
26
# podman search registry.redhat.io/rhel*|wc -l
26
# podman search registry.redhat.io/rhel7/*|wc -l
26
# podman search registry.redhat.io/rhel7/rhel*|wc -l
5

Need to confirm for the following testing.

1. can't find related image like registry.redhat.io/rhel7/rhel and registry.redhat.io/rhel7/rhel-tools
# podman search registry.redhat.io/rhel7/rh*l|wc -l
0

# podman search registry.redhat.io/rhel7/rhel-t*|wc -l
0

2. got incorrect output
# podman search registry.redhat.io/rhel7/rhel-to*
INDEX      NAME                                   DESCRIPTION                                      STARS   OFFICIAL  AUTOMATED
redhat.io  registry.redhat.io/rhel7-rhel-minimal  Red Hat Enterprise Linux Minimal Image is a ...  0
redhat.io  registry.redhat.io/rhel7/rhel-tools    Provides the core systems administrator and ...  0
redhat.io  registry.redhat.io/rhel7/rhel          This platform image provides a minimal runti...  0
redhat.io  registry.redhat.io/rhel7/rhel-atomic   Red Hat Enterprise Linux Atomic Image is a m...  0

Comment 22 Alex Jia 2021-01-14 04:06:42 UTC
Any updates for '2. got incorrect output' in Comment 21? thanks!

Comment 23 Miloslav Trmač 2021-01-14 14:28:58 UTC
*shrug* using raw access like
> curl 'https://registry.redhat.io/v1/search?n=25&q=rhel7/rhel-to*' | python -mjson.tool 
I see similar output (rhel-t* does not find rhel-tools, but rhel-to* does find both rhel-tools and rhel). So as far as Podman is concerned, this is consistent with comment#4 and comment#8. Why does the registry behave this way is an interesting question, but one that should be filed separately against the registry.

Comment 33 errata-xmlrpc 2021-02-16 14:21:45 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Moderate: container-tools:rhel8 security, bug fix, and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2021:0531


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