diff options
author | Miloslav Trmač <mitr@redhat.com> | 2021-09-11 22:15:23 +0200 |
---|---|---|
committer | Miloslav Trmač <mitr@redhat.com> | 2021-12-10 18:16:18 +0100 |
commit | 2aeb690d370de9fee15fc7c47b66fb04a30c41d8 (patch) | |
tree | 4335e8b649f5a4e5ed53b430fea613e7fe199c59 /pkg/api/handlers/libpod/manifests.go | |
parent | 491951d66e1829ad8e847f3049a557dd9d55db68 (diff) | |
download | podman-2aeb690d370de9fee15fc7c47b66fb04a30c41d8.tar.gz podman-2aeb690d370de9fee15fc7c47b66fb04a30c41d8.tar.bz2 podman-2aeb690d370de9fee15fc7c47b66fb04a30c41d8.zip |
Don't return a header name from auth.GetCredentials
Almost every caller is using it only to wrap an error
in exactly the same way, so move that error context into GetCredentials
and simplify the users.
(The one other caller, build, was even wrapping the error incorrectly
talking about query parameters; so let it use the same text as the others.)
Signed-off-by: Miloslav Trmač <mitr@redhat.com>
Diffstat (limited to 'pkg/api/handlers/libpod/manifests.go')
-rw-r--r-- | pkg/api/handlers/libpod/manifests.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/pkg/api/handlers/libpod/manifests.go b/pkg/api/handlers/libpod/manifests.go index 869c83fa3..eb0b6827f 100644 --- a/pkg/api/handlers/libpod/manifests.go +++ b/pkg/api/handlers/libpod/manifests.go @@ -176,9 +176,9 @@ func ManifestPush(w http.ResponseWriter, r *http.Request) { } source := utils.GetName(r) - authconf, authfile, key, err := auth.GetCredentials(r) + authconf, authfile, 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())) + utils.Error(w, "failed to retrieve repository credentials", http.StatusBadRequest, err) return } defer auth.RemoveAuthfile(authfile) |