Skip to content

Commit

Permalink
default os/arch for image export
Browse files Browse the repository at this point in the history
More defaulting is required to fix same issues as openllb#354 where os/arch is
required by buildkit
  • Loading branch information
coryb committed May 22, 2024
1 parent 748fac9 commit f882a8b
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions codegen/builtin_fs.go
Original file line number Diff line number Diff line change
Expand Up @@ -761,11 +761,20 @@ func (dp DockerPush) Call(ctx context.Context, cln *client.Client, val Value, op
}
exportFS.Image.ContainerConfig.Labels = exportFS.Image.Config.Labels

if exportFS.Image.OS == "" {
defaultPlat := DefaultPlatform(ctx)
switch {
case exportFS.Image.OS != "": // all good
case exportFS.Platform.OS != "":
exportFS.Image.OS = exportFS.Platform.OS
default:
exportFS.Image.OS = defaultPlat.OS
}
if exportFS.Image.Architecture == "" {
switch {
case exportFS.Image.Architecture != "": // all good
case exportFS.Platform.Architecture != "":
exportFS.Image.Architecture = exportFS.Platform.Architecture
default:
exportFS.Image.Architecture = defaultPlat.Architecture
}

var dgst string
Expand Down

0 comments on commit f882a8b

Please sign in to comment.