Tidy
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Rob Watson 2022-06-15 20:29:33 +02:00
parent e33612cced
commit 07552d10dd
1 changed files with 4 additions and 4 deletions

View File

@ -216,22 +216,22 @@ func copyLogStream(ctx context.Context, wg *sync.WaitGroup, client KubernetesCli
// Closing the reader ensures that the goroutine below is not leaked.
defer func() { _ = logReader.Close() }()
done := make(chan error, 1)
errch := make(chan error, 1)
go func() {
defer close(done)
defer close(errch)
scanner := bufio.NewScanner(logReader)
for scanner.Scan() {
logsLines <- "[" + stream.podName + "] " + scanner.Text() + nl
}
if err := scanner.Err(); err != nil {
done <- newLogError(fmt.Errorf("error scanning logs: %v", err), stream)
errch <- newLogError(fmt.Errorf("error scanning logs: %v", err), stream)
return
}
}()
for {
select {
case err := <-done:
case err := <-errch:
return err
case <-stream.done:
return nil