Skip to content

Commit

Permalink
Podman-remote build is getting ID twice
Browse files Browse the repository at this point in the history
This PR eliminates the second sending of the image id to the
podman-remote client.

Fixes: containers#8332

Signed-off-by: Daniel J Walsh <[email protected]>
  • Loading branch information
rhatdan committed Nov 14, 2020
1 parent 42a5b0f commit b5e15f1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
12 changes: 5 additions & 7 deletions pkg/api/handlers/compat/images_build.go
Original file line number Diff line number Diff line change
Expand Up @@ -272,15 +272,13 @@ loop:
flush()
case <-runCtx.Done():
if !failed {
if utils.IsLibpodRequest(r) {
m.Stream = imageID
} else {
if !utils.IsLibpodRequest(r) {
m.Stream = fmt.Sprintf("Successfully built %12.12s\n", imageID)
if err := enc.Encode(m); err != nil {
logrus.Warnf("Failed to json encode error %q", err.Error())
}
flush()
}
if err := enc.Encode(m); err != nil {
logrus.Warnf("Failed to json encode error %q", err.Error())
}
flush()
}
break loop
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/bindings/images/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ func Build(ctx context.Context, containerFiles []string, options entities.BuildO
case s.Stream != "":
stdout.Write([]byte(s.Stream))
if re.Match([]byte(s.Stream)) {
id = s.Stream
id = strings.TrimSuffix(s.Stream, "\n")
}
case s.Error != "":
return nil, errors.New(s.Error)
Expand Down

0 comments on commit b5e15f1

Please sign in to comment.