Remove dead code (#1425)

Co-authored-by: Casey Lee <cplee@nektos.com>
This commit is contained in:
Magnus Markling 2022-11-16 23:12:00 +01:00 committed by GitHub
parent 809da7198c
commit a108f10ccc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -22,59 +22,6 @@ type dockerMessage struct {
const logPrefix = " \U0001F433 "
/*
func logDockerOutput(ctx context.Context, dockerResponse io.Reader) {
logger := common.Logger(ctx)
if entry, ok := logger.(*logrus.Entry); ok {
w := entry.Writer()
_, err := stdcopy.StdCopy(w, w, dockerResponse)
if err != nil {
logrus.Error(err)
}
} else if lgr, ok := logger.(*logrus.Logger); ok {
w := lgr.Writer()
_, err := stdcopy.StdCopy(w, w, dockerResponse)
if err != nil {
logrus.Error(err)
}
} else {
logrus.Errorf("Unable to get writer from logger (type=%T)", logger)
}
}
*/
/*
func streamDockerOutput(ctx context.Context, dockerResponse io.Reader) {
/*
out := os.Stdout
go func() {
<-ctx.Done()
//fmt.Println()
}()
_, err := io.Copy(out, dockerResponse)
if err != nil {
logrus.Error(err)
}
* /
logger := common.Logger(ctx)
reader := bufio.NewReader(dockerResponse)
for {
if ctx.Err() != nil {
break
}
line, _, err := reader.ReadLine()
if err == io.EOF {
break
}
logger.Debugf("%s\n", line)
}
}
*/
func logDockerResponse(logger logrus.FieldLogger, dockerResponse io.ReadCloser, isError bool) error {
if dockerResponse == nil {
return nil