Skip to content

Commit

Permalink
Merge pull request #3290 from telepresenceio/shepz/fix-pull-image
Browse files Browse the repository at this point in the history
Remove docker scout message when pulling a docker image
  • Loading branch information
shepz authored Aug 7, 2023
2 parents a76a6fb + 40ea304 commit b613bfe
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion pkg/client/docker/image.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ package docker
import (
"bytes"
"context"
"fmt"
"io"
"os"
"strings"

"github.com/telepresenceio/telepresence/v2/pkg/proc"
Expand Down Expand Up @@ -34,5 +36,16 @@ func PullImage(ctx context.Context, image string) error {
// Docker run will put the pull logs in stderr, but docker pull will put them in stdout.
// We discard them here, so they don't spam the user. They'll get errors through stderr if it comes to it.
cmd.Stdout = io.Discard
return cmd.Run()

// Only print stderr if the return code is non-zero
var stderr bytes.Buffer
cmd.Stderr = &stderr

err = cmd.Run()
if err != nil {
fmt.Fprint(os.Stderr, stderr.String())
return err
}

return nil
}

0 comments on commit b613bfe

Please sign in to comment.