mirror of https://github.com/containers/podman.git
bindings, build: don't pass invalid platform in case of none
In case of no `platform` , bindings should not add `platform` to parameters at all instead it adds `/` as platform string which is invalid. [NO NEW TESTS NEEDED] Exsiting test should pass with new buildah from upstream. Closes: https://github.com/containers/buildah/issues/4768 Signed-off-by: Aditya R <arajan@redhat.com>
This commit is contained in:
parent
d494af9647
commit
e1e03a0e34
|
|
@ -298,6 +298,12 @@ func Build(ctx context.Context, containerFiles []string, options entities.BuildO
|
|||
if len(options.Platforms) > 0 {
|
||||
params.Del("platform")
|
||||
for _, platformSpec := range options.Platforms {
|
||||
// podman-cli will send empty struct, in such
|
||||
// case don't add platform to param and let the
|
||||
// build backend decide the default platform.
|
||||
if platformSpec.OS == "" && platformSpec.Arch == "" && platformSpec.Variant == "" {
|
||||
continue
|
||||
}
|
||||
platform = platformSpec.OS + "/" + platformSpec.Arch
|
||||
if platformSpec.Variant != "" {
|
||||
platform += "/" + platformSpec.Variant
|
||||
|
|
|
|||
Loading…
Reference in New Issue