Skip to content

Commit

Permalink
Suppress Docker output in parallel stage applies
Browse files Browse the repository at this point in the history
  • Loading branch information
ethanjli committed Dec 17, 2024
1 parent dd0dc6a commit 0d77ddc
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions internal/app/forklift/cli/staging.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package cli
import (
"context"
"fmt"
"io"
"os"
"path"
"path/filepath"
Expand Down Expand Up @@ -527,9 +528,10 @@ func applyChangesConcurrently(indent int, plan structures.Digraph[*Reconciliatio
const dockerIndent = 2 // docker's indentation is flaky, so we indent extra
dc, err := docker.NewClient(
docker.WithConcurrencySafeOutput(),
// we want to send all of Docker's log messages to stderr:
docker.WithOutputStream(cli.NewIndentedWriter(indent+dockerIndent, os.Stderr)),
docker.WithErrorStream(cli.NewIndentedWriter(indent+dockerIndent, os.Stderr)),
// Docker's usual stderr output looks weird with concurrency, so we discard it.
// TODO: direct it to a concurrency-safe logger instead?
docker.WithErrorStream(cli.NewIndentedWriter(indent+dockerIndent, io.Discard)),
)
if err != nil {
return errors.Wrap(err, "couldn't make Docker API client")
Expand Down

0 comments on commit 0d77ddc

Please sign in to comment.