Merge pull request #2424 from jaihwan104/exit-1-when-manifest-merge-failed

fix exit code when manifest merge failed
This commit is contained in:
Tõnis Tiigi 2024-04-24 16:37:18 -07:00 committed by GitHub
commit 771e66bf7a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 2 deletions

View File

@ -541,7 +541,7 @@ func BuildWithResultHandler(ctx context.Context, nodes []builder.Node, opt map[s
}
if pushNames != "" {
progress.Write(pw, fmt.Sprintf("merging manifest list %s", pushNames), func() error {
err := progress.Write(pw, fmt.Sprintf("merging manifest list %s", pushNames), func() error {
descs := make([]specs.Descriptor, 0, len(res))
for _, r := range res {
@ -637,6 +637,9 @@ func BuildWithResultHandler(ctx context.Context, nodes []builder.Node, opt map[s
}
return nil
})
if err != nil {
return err
}
}
return nil
})

View File

@ -15,7 +15,7 @@ type Writer interface {
ClearLogSource(interface{})
}
func Write(w Writer, name string, f func() error) {
func Write(w Writer, name string, f func() error) error {
dgst := digest.FromBytes([]byte(identity.NewID()))
tm := time.Now()
@ -40,6 +40,8 @@ func Write(w Writer, name string, f func() error) {
w.Write(&client.SolveStatus{
Vertexes: []*client.Vertex{&vtx2},
})
return err
}
func WriteBuildRef(w Writer, target string, ref string) {