mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-08-30 23:37:45 +00:00
runtime: skip empty Guest console output lines
Skip logging empty lines of text from the Guest console output, if there are any such lines. Without this change, the Guest console log from CLH + /dev/pts/0 has twice as many lines of text. Half of these lines are empty. Fixes: #10737 Signed-off-by: Dan Mihai <dmihai@microsoft.com>
This commit is contained in:
@@ -1275,12 +1275,15 @@ func (cw *consoleWatcher) start(s *Sandbox) (err error) {
|
||||
|
||||
go func() {
|
||||
for scanner.Scan() {
|
||||
s.Logger().WithFields(logrus.Fields{
|
||||
"console-protocol": cw.proto,
|
||||
"console-url": cw.consoleURL,
|
||||
"sandbox": s.id,
|
||||
"vmconsole": scanner.Text(),
|
||||
}).Debug("reading guest console")
|
||||
text := scanner.Text()
|
||||
if text != "" {
|
||||
s.Logger().WithFields(logrus.Fields{
|
||||
"console-protocol": cw.proto,
|
||||
"console-url": cw.consoleURL,
|
||||
"sandbox": s.id,
|
||||
"vmconsole": text,
|
||||
}).Debug("reading guest console")
|
||||
}
|
||||
}
|
||||
|
||||
if err := scanner.Err(); err != nil {
|
||||
|
Reference in New Issue
Block a user