mirror of
https://github.com/containers/podman.git
synced 2025-10-29 08:57:26 +08:00
Document docker transport is the only supported remote transport
The goal is to improve errors when users use the wrong transport in certain cases we stutter, in other cases we don't give enough information. Remove stutters when failing to pull remote images, because of lack of support. Fix errors returned by reference.Parse to wrap in image that was being checked. Fixes: https://github.com/containers/podman/issues/7116 Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
This commit is contained in:
@ -422,8 +422,7 @@ func PushImage(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
source := strings.TrimSuffix(utils.GetName(r), "/push") // GetName returns the entire path
|
||||
if _, err := utils.ParseStorageReference(source); err != nil {
|
||||
utils.Error(w, http.StatusText(http.StatusBadRequest), http.StatusBadRequest,
|
||||
errors.Wrapf(err, "image source %q is not a containers-storage-transport reference", source))
|
||||
utils.Error(w, http.StatusText(http.StatusBadRequest), http.StatusBadRequest, err)
|
||||
return
|
||||
}
|
||||
|
||||
@ -433,8 +432,7 @@ func PushImage(w http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
|
||||
if _, err := utils.ParseDockerReference(destination); err != nil {
|
||||
utils.Error(w, http.StatusText(http.StatusBadRequest), http.StatusBadRequest,
|
||||
errors.Wrapf(err, "image destination %q is not a docker-transport reference", destination))
|
||||
utils.Error(w, http.StatusText(http.StatusBadRequest), http.StatusBadRequest, err)
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
@ -53,8 +53,7 @@ func ImagesPull(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
imageRef, err := utils.ParseDockerReference(query.Reference)
|
||||
if err != nil {
|
||||
utils.Error(w, http.StatusText(http.StatusBadRequest), http.StatusBadRequest,
|
||||
errors.Wrapf(err, "image destination %q is not a docker-transport reference", query.Reference))
|
||||
utils.Error(w, http.StatusText(http.StatusBadRequest), http.StatusBadRequest, err)
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user