Skip to content

Commit b47ee0b

Browse files
committed
Suppress extensive verbose output
1 parent 11c560a commit b47ee0b

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

internal/test/container.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -167,17 +167,17 @@ func runTest(ctx context.Context, logger *log.Logger, w io.Writer, dockerDaemon
167167
}
168168

169169
resp, err := dockerDaemon.ImageBuild(ctx, &dockerfileTarball, build.ImageBuildOptions{
170-
Tags: []string{"kiln_test_dependencies:vmware"},
171-
BuildArgs: buildArgs,
172-
AuthConfigs: authConfigs,
170+
Tags: []string{"kiln_test_dependencies:vmware"},
171+
BuildArgs: buildArgs,
172+
AuthConfigs: authConfigs,
173+
SuppressOutput: true,
173174
})
174175

175176
if err != nil {
176177
return fmt.Errorf("failed to build image: %w", err)
177178
}
178179

179-
logger.Println("reading image build response")
180-
if err := checkImageBuildResponse(resp.Body, w); err != nil {
180+
if err := checkImageBuildResponse(resp.Body, nil); err != nil {
181181
return fmt.Errorf("image build failed: %w", err)
182182
}
183183

@@ -421,9 +421,9 @@ type imageBuildMessage struct {
421421
} `json:"errorDetail"`
422422
}
423423

424-
// checkImageBuildResponse reads the Docker/Podman image-build JSON stream. It
425-
// copies "stream" lines to logOutput (when non-nil) so RUN step logs (e.g. go
426-
// install failures) are visible; it returns an error if the daemon reports failure.
424+
// checkImageBuildResponse reads the Docker/Podman image-build JSON stream. If
425+
// logOutput is non-nil, "stream" lines are copied there; otherwise they are
426+
// discarded. Build failures are still returned from daemon "error" messages.
427427
func checkImageBuildResponse(body io.ReadCloser, logOutput io.Writer) error {
428428
defer func() {
429429
_ = body.Close()

0 commit comments

Comments
 (0)