summaryrefslogtreecommitdiff
path: root/cmd/podman/shared
diff options
context:
space:
mode:
authorNalin Dahyabhai <nalin@redhat.com>2019-10-16 11:57:45 -0400
committerNalin Dahyabhai <nalin@redhat.com>2019-10-29 13:35:19 -0400
commitb9313d355e8cd6307d8772ad9c21958ffe981e5b (patch)
treef186c35ba6cf3414e39750330d10773687f7e7d2 /cmd/podman/shared
parent803357334ce72e14f263a0951d83cdab3fff2bde (diff)
downloadpodman-b9313d355e8cd6307d8772ad9c21958ffe981e5b.tar.gz
podman-b9313d355e8cd6307d8772ad9c21958ffe981e5b.tar.bz2
podman-b9313d355e8cd6307d8772ad9c21958ffe981e5b.zip
pull/create: add --override-arch/--override-os flags
Add --override-arch and --override-os as hidden flags, in line with the global flag names that skopeo uses, so that we can test behavior around manifest lists without having to conditionalize more of it by arch. Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Diffstat (limited to 'cmd/podman/shared')
-rw-r--r--cmd/podman/shared/create.go7
-rw-r--r--cmd/podman/shared/intermediate.go2
-rw-r--r--cmd/podman/shared/intermediate_varlink.go4
3 files changed, 12 insertions, 1 deletions
diff --git a/cmd/podman/shared/create.go b/cmd/podman/shared/create.go
index f37f5fa62..759903c19 100644
--- a/cmd/podman/shared/create.go
+++ b/cmd/podman/shared/create.go
@@ -89,7 +89,12 @@ func CreateContainer(ctx context.Context, c *GenericCLIResults, runtime *libpod.
return nil, nil, err
}
- newImage, err := runtime.ImageRuntime().New(ctx, name, rtc.SignaturePolicyPath, GetAuthFile(c.String("authfile")), writer, nil, image.SigningOptions{}, nil, pullType)
+ dockerRegistryOptions := image.DockerRegistryOptions{
+ OSChoice: c.String("override-os"),
+ ArchitectureChoice: c.String("override-arch"),
+ }
+
+ newImage, err := runtime.ImageRuntime().New(ctx, name, rtc.SignaturePolicyPath, GetAuthFile(c.String("authfile")), writer, &dockerRegistryOptions, image.SigningOptions{}, nil, pullType)
if err != nil {
return nil, nil, err
}
diff --git a/cmd/podman/shared/intermediate.go b/cmd/podman/shared/intermediate.go
index 0f71dc087..bc12bd2a5 100644
--- a/cmd/podman/shared/intermediate.go
+++ b/cmd/podman/shared/intermediate.go
@@ -428,6 +428,8 @@ func NewIntermediateLayer(c *cliconfig.PodmanCommand, remote bool) GenericCLIRes
m["no-hosts"] = newCRBool(c, "no-hosts")
m["oom-kill-disable"] = newCRBool(c, "oom-kill-disable")
m["oom-score-adj"] = newCRInt(c, "oom-score-adj")
+ m["override-arch"] = newCRString(c, "override-arch")
+ m["override-os"] = newCRString(c, "override-os")
m["pid"] = newCRString(c, "pid")
m["pids-limit"] = newCRInt64(c, "pids-limit")
m["pod"] = newCRString(c, "pod")
diff --git a/cmd/podman/shared/intermediate_varlink.go b/cmd/podman/shared/intermediate_varlink.go
index c95470a72..89bd52324 100644
--- a/cmd/podman/shared/intermediate_varlink.go
+++ b/cmd/podman/shared/intermediate_varlink.go
@@ -131,6 +131,8 @@ func (g GenericCLIResults) MakeVarlink() iopodman.Create {
Network: StringToPtr(g.Find("network")),
OomKillDisable: BoolToPtr(g.Find("oom-kill-disable")),
OomScoreAdj: AnyIntToInt64Ptr(g.Find("oom-score-adj")),
+ OverrideOS: StringToPtr(g.Find("override-os")),
+ OverrideArch: StringToPtr(g.Find("override-arch")),
Pid: StringToPtr(g.Find("pid")),
PidsLimit: AnyIntToInt64Ptr(g.Find("pids-limit")),
Pod: StringToPtr(g.Find("pod")),
@@ -389,6 +391,8 @@ func VarlinkCreateToGeneric(opts iopodman.Create) GenericCLIResults {
m["no-hosts"] = boolFromVarlink(opts.NoHosts, "no-hosts", false)
m["oom-kill-disable"] = boolFromVarlink(opts.OomKillDisable, "oon-kill-disable", false)
m["oom-score-adj"] = intFromVarlink(opts.OomScoreAdj, "oom-score-adj", nil)
+ m["override-os"] = stringFromVarlink(opts.OverrideOS, "override-os", nil)
+ m["override-arch"] = stringFromVarlink(opts.OverrideArch, "override-arch", nil)
m["pid"] = stringFromVarlink(opts.Pid, "pid", nil)
m["pids-limit"] = int64FromVarlink(opts.PidsLimit, "pids-limit", nil)
m["pod"] = stringFromVarlink(opts.Pod, "pod", nil)