Skip to content

Commit

Permalink
default stack.toml to use first run image
Browse files Browse the repository at this point in the history
Signed-off-by: Joe Kutner <jpkutner@gmail.com>
  • Loading branch information
jkutner committed Apr 12, 2023
1 parent fe1db21 commit 1b52878
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
7 changes: 6 additions & 1 deletion internal/builder/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -932,7 +932,12 @@ func orderFileContents(order dist.Order, orderExt dist.Order) (string, error) {

func (b *Builder) stackLayer(dest string) (string, error) {
buf := &bytes.Buffer{}
err := toml.NewEncoder(buf).Encode(b.metadata.Stack)
var err error
if b.metadata.Stack.RunImage.Image != "" {
err = toml.NewEncoder(buf).Encode(b.metadata.Stack)
} else if len(b.metadata.RunImages) > 0 {
err = toml.NewEncoder(buf).Encode(b.metadata.RunImages[0])
}
if err != nil {
return "", errors.Wrapf(err, "failed to marshal stack.toml")
}
Expand Down
4 changes: 2 additions & 2 deletions internal/builder/writer/human_readable.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ Created By:
{{ end -}}
Trusted: {{.Trusted}}
{{ if ne .Info.Stack "" -}}
Stack:
{{ if ne .Info.Stack "" -}}Stack:
ID: {{ .Info.Stack }}{{ end -}}
{{- if .Verbose}}
{{- if ne (len .Info.Mixins) 0 }}
Expand Down

0 comments on commit 1b52878

Please sign in to comment.