Skip to content

Commit 0d93f59

Browse files
authored
Merge pull request kata-containers#10738 from microsoft/danmihai1/empty-pty-lines
runtime: skip empty Guest console output lines
2 parents 365def9 + 2e21f51 commit 0d93f59

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

src/runtime/virtcontainers/sandbox.go

+9-6
Original file line numberDiff line numberDiff line change
@@ -1275,12 +1275,15 @@ func (cw *consoleWatcher) start(s *Sandbox) (err error) {
12751275

12761276
go func() {
12771277
for scanner.Scan() {
1278-
s.Logger().WithFields(logrus.Fields{
1279-
"console-protocol": cw.proto,
1280-
"console-url": cw.consoleURL,
1281-
"sandbox": s.id,
1282-
"vmconsole": scanner.Text(),
1283-
}).Debug("reading guest console")
1278+
text := scanner.Text()
1279+
if text != "" {
1280+
s.Logger().WithFields(logrus.Fields{
1281+
"console-protocol": cw.proto,
1282+
"console-url": cw.consoleURL,
1283+
"sandbox": s.id,
1284+
"vmconsole": text,
1285+
}).Debug("reading guest console")
1286+
}
12841287
}
12851288

12861289
if err := scanner.Err(); err != nil {

0 commit comments

Comments
 (0)