summaryrefslogtreecommitdiff
path: root/pkg/api
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2022-03-23 13:15:47 +0100
committerGitHub <noreply@github.com>2022-03-23 13:15:47 +0100
commita8743d3327b9a97ea812632885492d95c816d79a (patch)
treea484397dcb515c20e1e6c62fe7a08510794e1581 /pkg/api
parent9d8972e0ee665325a2519eb168423d773856d563 (diff)
parenteedce31eb4aa8c0678c24cdf907ebd971ce02233 (diff)
downloadpodman-a8743d3327b9a97ea812632885492d95c816d79a.tar.gz
podman-a8743d3327b9a97ea812632885492d95c816d79a.tar.bz2
podman-a8743d3327b9a97ea812632885492d95c816d79a.zip
Merge pull request #13588 from flouthoc/import-os-arch
import: allow users to set `--os`, `--arch` and `--variant` of image imports
Diffstat (limited to 'pkg/api')
-rw-r--r--pkg/api/handlers/libpod/images.go22
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 {