summaryrefslogtreecommitdiff
path: root/pkg/api/handlers/libpod
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2020-10-20 15:34:56 -0400
committerGitHub <noreply@github.com>2020-10-20 15:34:56 -0400
commit4822cc8cabce33732cb210103aaa208f81102c5d (patch)
tree366b14e2215e42ddbe7630be59b2e4bcde9b04b8 /pkg/api/handlers/libpod
parent6961b9475dbcbc6112d9c6022ac264c923ce083d (diff)
parent3d2ad0f97a35617f76f30d02bbfa8aa1a7c1f958 (diff)
downloadpodman-4822cc8cabce33732cb210103aaa208f81102c5d.tar.gz
podman-4822cc8cabce33732cb210103aaa208f81102c5d.tar.bz2
podman-4822cc8cabce33732cb210103aaa208f81102c5d.zip
Merge pull request #8042 from rhatdan/tlsverify
--tls-verify and --authfile should work for all remote commands
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)