summaryrefslogtreecommitdiff
path: root/pkg/api/handlers/libpod
diff options
context:
space:
mode:
authorDaniel J Walsh <dwalsh@redhat.com>2020-10-16 04:56:27 -0400
committerDaniel J Walsh <dwalsh@redhat.com>2020-10-19 05:55:11 -0400
commit3d2ad0f97a35617f76f30d02bbfa8aa1a7c1f958 (patch)
treea202c1cba3f66ecd51f95d1be9bdf24febd06681 /pkg/api/handlers/libpod
parent7ffcab0854342844a44b2668bd9d98849bf935c8 (diff)
downloadpodman-3d2ad0f97a35617f76f30d02bbfa8aa1a7c1f958.tar.gz
podman-3d2ad0f97a35617f76f30d02bbfa8aa1a7c1f958.tar.bz2
podman-3d2ad0f97a35617f76f30d02bbfa8aa1a7c1f958.zip
--tls-verify and --authfile should work for all remote commands
These options are now fully supported in the remote API and should no longer be hidden and/or documented as non supported. Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Diffstat (limited to 'pkg/api/handlers/libpod')
-rw-r--r--pkg/api/handlers/libpod/images.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/pkg/api/handlers/libpod/images.go b/pkg/api/handlers/libpod/images.go
index 1292090fb..3fb5d23c8 100644
--- a/pkg/api/handlers/libpod/images.go
+++ b/pkg/api/handlers/libpod/images.go
@@ -636,6 +636,14 @@ func SearchImages(w http.ResponseWriter, r *http.Request) {
options.Filter = *filter
}
+ _, authfile, key, err := auth.GetCredentials(r)
+ if err != nil {
+ utils.Error(w, "failed to retrieve repository credentials", http.StatusBadRequest, errors.Wrapf(err, "failed to parse %q header for %s", key, r.URL.String()))
+ return
+ }
+ defer auth.RemoveAuthfile(authfile)
+ options.Authfile = authfile
+
searchResults, err := image.SearchImages(query.Term, options)
if err != nil {
utils.BadRequest(w, "term", query.Term, err)