Skip to content

Commit

Permalink
Merge pull request #355 from coryb/export-default-os
Browse files Browse the repository at this point in the history
default os/arch for image export
  • Loading branch information
coryb authored May 22, 2024
2 parents 748fac9 + f882a8b commit ac2fa9b
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 ac2fa9b

Please sign in to comment.