diff options
author | Aditya R <arajan@redhat.com> | 2022-03-22 17:16:52 +0530 |
---|---|---|
committer | Aditya R <arajan@redhat.com> | 2022-03-23 11:22:55 +0530 |
commit | eedce31eb4aa8c0678c24cdf907ebd971ce02233 (patch) | |
tree | 0b254749304a008a3e2cc2425f0bbc7978964e2e /pkg/api/handlers | |
parent | d0e9f28f87d4fc9e7ed8f465709db89a03b9376b (diff) | |
download | podman-eedce31eb4aa8c0678c24cdf907ebd971ce02233.tar.gz podman-eedce31eb4aa8c0678c24cdf907ebd971ce02233.tar.bz2 podman-eedce31eb4aa8c0678c24cdf907ebd971ce02233.zip |
import: allow users to set os, arch and variant of imports
Allows users to set `--os` , `--arch` and `--variant` of the image
created from the custom import.
Following is useful when user is already aware of the values which are
correct for their generated rootfs
Signed-off-by: Aditya R <arajan@redhat.com>
Diffstat (limited to 'pkg/api/handlers')
-rw-r--r-- | pkg/api/handlers/libpod/images.go | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/pkg/api/handlers/libpod/images.go b/pkg/api/handlers/libpod/images.go index d59a83342..cddf4c205 100644 --- a/pkg/api/handlers/libpod/images.go +++ b/pkg/api/handlers/libpod/images.go @@ -367,10 +367,13 @@ func ImagesImport(w http.ResponseWriter, r *http.Request) { runtime := r.Context().Value(api.RuntimeKey).(*libpod.Runtime) decoder := r.Context().Value(api.DecoderKey).(*schema.Decoder) query := struct { - Changes []string `schema:"changes"` - Message string `schema:"message"` - Reference string `schema:"reference"` - URL string `schema:"URL"` + Changes []string `schema:"changes"` + Message string `schema:"message"` + Reference string `schema:"reference"` + URL string `schema:"URL"` + OS string `schema:"OS"` + Architecture string `schema:"Architecture"` + Variant string `schema:"Variant"` }{ // Add defaults here once needed. } @@ -402,10 +405,13 @@ func ImagesImport(w http.ResponseWriter, r *http.Request) { imageEngine := abi.ImageEngine{Libpod: runtime} importOptions := entities.ImageImportOptions{ - Changes: query.Changes, - Message: query.Message, - Reference: query.Reference, - Source: source, + Changes: query.Changes, + Message: query.Message, + Reference: query.Reference, + OS: query.OS, + Architecture: query.Architecture, + Variant: query.Variant, + Source: source, } report, err := imageEngine.Import(r.Context(), importOptions) if err != nil { |