diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2022-01-15 20:39:16 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-15 20:39:16 +0100 |
commit | 3c9e41bb5393e0a857d8755bb50345544cc31b50 (patch) | |
tree | 9f2af691f56081271e7fff6971ddd7e5fe45271a /pkg/api/handlers/utils | |
parent | fff9e8755c298bfe2b3b0c33c4b96ffd43a1eab6 (diff) | |
parent | 14940a067d007af445560a0a7eb414f6547a7cd4 (diff) | |
download | podman-3c9e41bb5393e0a857d8755bb50345544cc31b50.tar.gz podman-3c9e41bb5393e0a857d8755bb50345544cc31b50.tar.bz2 podman-3c9e41bb5393e0a857d8755bb50345544cc31b50.zip |
Merge pull request #12572 from rhatdan/image
Remove two GetImages functions from API
Diffstat (limited to 'pkg/api/handlers/utils')
-rw-r--r-- | pkg/api/handlers/utils/images.go | 40 |
1 files changed, 0 insertions, 40 deletions
diff --git a/pkg/api/handlers/utils/images.go b/pkg/api/handlers/utils/images.go index 3f3f48193..639de9915 100644 --- a/pkg/api/handlers/utils/images.go +++ b/pkg/api/handlers/utils/images.go @@ -6,7 +6,6 @@ import ( "strings" "github.com/containers/common/libimage" - "github.com/containers/common/pkg/filters" "github.com/containers/image/v5/docker" storageTransport "github.com/containers/image/v5/storage" "github.com/containers/image/v5/transports/alltransports" @@ -16,7 +15,6 @@ import ( "github.com/containers/podman/v3/pkg/util" "github.com/containers/storage" "github.com/docker/distribution/reference" - "github.com/gorilla/schema" "github.com/pkg/errors" ) @@ -91,44 +89,6 @@ func ParseStorageReference(name string) (types.ImageReference, error) { return imageRef, nil } -// GetImages is a common function used to get images for libpod and other compatibility -// mechanisms -func GetImages(w http.ResponseWriter, r *http.Request) ([]*libimage.Image, error) { - decoder := r.Context().Value(api.DecoderKey).(*schema.Decoder) - runtime := r.Context().Value(api.RuntimeKey).(*libpod.Runtime) - query := struct { - All bool - Digests bool - Filter string // Docker 1.24 compatibility - }{ - // This is where you can override the golang default value for one of fields - } - - if err := decoder.Decode(&query, r.URL.Query()); err != nil { - return nil, err - } - if _, found := r.URL.Query()["digests"]; found && query.Digests { - UnSupportedParameter("digests") - } - - filterList, err := filters.FiltersFromRequest(r) - if err != nil { - return nil, err - } - if !IsLibpodRequest(r) && len(query.Filter) > 0 { // Docker 1.24 compatibility - filterList = append(filterList, "reference="+query.Filter) - } - - if !query.All { - // Filter intermediate images unless we want to list *all*. - // NOTE: it's a positive filter, so `intermediate=false` means - // to display non-intermediate images. - filterList = append(filterList, "intermediate=false") - } - listOptions := &libimage.ListImagesOptions{Filters: filterList} - return runtime.LibimageRuntime().ListImages(r.Context(), nil, listOptions) -} - func GetImage(r *http.Request, name string) (*libimage.Image, error) { runtime := r.Context().Value(api.RuntimeKey).(*libpod.Runtime) image, _, err := runtime.LibimageRuntime().LookupImage(name, nil) |