summaryrefslogtreecommitdiff
path: root/pkg/bindings/images
diff options
context:
space:
mode:
authorNalin Dahyabhai <nalin@redhat.com>2021-09-14 11:52:51 -0400
committerNalin Dahyabhai <nalin@redhat.com>2021-09-14 17:09:06 -0400
commit5dbf3ee7aeef6e2aca5512b3ad8684610080d421 (patch)
treeaa4785ac69c811e767ddfcdb394925a572f20d34 /pkg/bindings/images
parent6a34045c670b3f0184b4ba88faeb11bb4a58c747 (diff)
downloadpodman-5dbf3ee7aeef6e2aca5512b3ad8684610080d421.tar.gz
podman-5dbf3ee7aeef6e2aca5512b3ad8684610080d421.tar.bz2
podman-5dbf3ee7aeef6e2aca5512b3ad8684610080d421.zip
build: take advantage of --platform lists
The builder can take a list of platforms in the Platforms field of its BuildOptions argument, and we should definitely take advantage of that. The `bud-multiple-platform-values` test from buildah exercises support for this, so [NO TESTS NEEDED] Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Diffstat (limited to 'pkg/bindings/images')
-rw-r--r--pkg/bindings/images/build.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/pkg/bindings/images/build.go b/pkg/bindings/images/build.go
index 3beafa585..9d5aad23b 100644
--- a/pkg/bindings/images/build.go
+++ b/pkg/bindings/images/build.go
@@ -220,6 +220,16 @@ func Build(ctx context.Context, containerFiles []string, options entities.BuildO
if len(platform) > 0 {
params.Set("platform", platform)
}
+ if len(options.Platforms) > 0 {
+ params.Del("platform")
+ for _, platformSpec := range options.Platforms {
+ platform = platformSpec.OS + "/" + platformSpec.Arch
+ if platformSpec.Variant != "" {
+ platform += "/" + platformSpec.Variant
+ }
+ params.Add("platform", platform)
+ }
+ }
params.Set("pullpolicy", options.PullPolicy.String())