summaryrefslogtreecommitdiff
path: root/pkg/api
diff options
context:
space:
mode:
authorQi Wang <qiwan@redhat.com>2020-09-29 16:40:10 -0400
committerQi Wang <qiwan@redhat.com>2020-10-09 11:49:46 -0400
commit66798e993a1d3c111f15a85242cac1427c39f53e (patch)
treeead22c734350fa97d4fc1d611d1934be233f3c59 /pkg/api
parent73488369586d387db0e4754fa56d5d0077a24940 (diff)
downloadpodman-66798e993a1d3c111f15a85242cac1427c39f53e.tar.gz
podman-66798e993a1d3c111f15a85242cac1427c39f53e.tar.bz2
podman-66798e993a1d3c111f15a85242cac1427c39f53e.zip
Search repository tags using --list-tags
For fix of BZ: https://bugzilla.redhat.com/show_bug.cgi?id=1684263 Add --list-tags to podman search to return a table the repository tags. Signed-off-by: Qi Wang <qiwan@redhat.com>
Diffstat (limited to 'pkg/api')
-rw-r--r--pkg/api/handlers/libpod/images.go7
-rw-r--r--pkg/api/server/register_images.go4
2 files changed, 9 insertions, 2 deletions
diff --git a/pkg/api/handlers/libpod/images.go b/pkg/api/handlers/libpod/images.go
index 43123c5a3..1292090fb 100644
--- a/pkg/api/handlers/libpod/images.go
+++ b/pkg/api/handlers/libpod/images.go
@@ -608,6 +608,7 @@ func SearchImages(w http.ResponseWriter, r *http.Request) {
NoTrunc bool `json:"noTrunc"`
Filters []string `json:"filters"`
TLSVerify bool `json:"tlsVerify"`
+ ListTags bool `json:"listTags"`
}{
// This is where you can override the golang default value for one of fields
}
@@ -618,8 +619,9 @@ func SearchImages(w http.ResponseWriter, r *http.Request) {
}
options := image.SearchOptions{
- Limit: query.Limit,
- NoTrunc: query.NoTrunc,
+ Limit: query.Limit,
+ NoTrunc: query.NoTrunc,
+ ListTags: query.ListTags,
}
if _, found := r.URL.Query()["tlsVerify"]; found {
options.InsecureSkipTLSVerify = types.NewOptionalBool(!query.TLSVerify)
@@ -650,6 +652,7 @@ func SearchImages(w http.ResponseWriter, r *http.Request) {
reports[i].Stars = searchResults[i].Stars
reports[i].Official = searchResults[i].Official
reports[i].Automated = searchResults[i].Automated
+ reports[i].Tag = searchResults[i].Tag
}
utils.WriteResponse(w, http.StatusOK, reports)
diff --git a/pkg/api/server/register_images.go b/pkg/api/server/register_images.go
index ad779203d..c2423218a 100644
--- a/pkg/api/server/register_images.go
+++ b/pkg/api/server/register_images.go
@@ -169,6 +169,10 @@ func (s *APIServer) registerImagesHandlers(r *mux.Router) error {
// - `is-automated=(true|false)`
// - `is-official=(true|false)`
// - `stars=<number>` Matches images that has at least 'number' stars.
+ // - in: query
+ // name: listTags
+ // type: boolean
+ // description: list the available tags in the repository
// produces:
// - application/json
// responses: