Skip to content

Commit

Permalink
Re-enabled streaming output for docker pull
Browse files Browse the repository at this point in the history
  • Loading branch information
dcwangmit01 authored and rtluckie committed Sep 24, 2018
1 parent 438c21f commit 573cfe6
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions pkg/kdk/pull.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@
package kdk

import (
"bytes"
"io"
"io/ioutil"
"os"

log "github.com/Sirupsen/logrus"
"github.com/docker/docker/api/types"
Expand All @@ -29,9 +30,13 @@ func Pull(cfg *KdkEnvConfig) error {
}
defer out.Close()

var buf bytes.Buffer
io.Copy(&buf, out)
log.Debug(string(buf.Bytes()))
// Silence the output for Info loglevel, but allow it through all
// others. This is a cheap way to enable streaming output.
if log.GetLevel() == log.InfoLevel {
io.Copy(ioutil.Discard, out)
} else {
io.Copy(os.Stdout, out)
}

return err
}

0 comments on commit 573cfe6

Please sign in to comment.