Merge pull request #10738 from microsoft/danmihai1/empty-pty-lines

runtime: skip empty Guest console output lines
This commit is contained in:
Aurélien Bombo 2025-01-15 10:33:24 -06:00 committed by GitHub
commit 0d93f59f5b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1275,12 +1275,15 @@ func (cw *consoleWatcher) start(s *Sandbox) (err error) {
go func() { go func() {
for scanner.Scan() { for scanner.Scan() {
s.Logger().WithFields(logrus.Fields{ text := scanner.Text()
"console-protocol": cw.proto, if text != "" {
"console-url": cw.consoleURL, s.Logger().WithFields(logrus.Fields{
"sandbox": s.id, "console-protocol": cw.proto,
"vmconsole": scanner.Text(), "console-url": cw.consoleURL,
}).Debug("reading guest console") "sandbox": s.id,
"vmconsole": text,
}).Debug("reading guest console")
}
} }
if err := scanner.Err(); err != nil { if err := scanner.Err(); err != nil {