Skip to content

Commit

Permalink
If BuildImage fails but logs something about success, don't succeed (#…
Browse files Browse the repository at this point in the history
…2305)

This patch ensures that if the docker build commands result in logging
the string "Successfully built", the callback from that build will still
fail if there was an error in building.

Fixes #2184
  • Loading branch information
niloc132 committed Feb 26, 2024
1 parent 129f786 commit 4d8c436
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,14 @@ public String awaitImageId(long timeout, TimeUnit timeUnit) {
}

private String getImageId() {
if (imageId != null) {
return imageId;
if (error != null) {
throw new DockerClientException("Could not build image: " + error);
}

if (error == null) {
throw new DockerClientException("Could not build image");
if (imageId != null) {
return imageId;
}

throw new DockerClientException("Could not build image: " + error);
throw new DockerClientException("Could not build image");
}
}

0 comments on commit 4d8c436

Please sign in to comment.