Merge pull request #1322 from lifupan/fixconsole

virtcontainer: watch the qemu's console when proxy's debug enabled
This commit is contained in:
Sebastien Boeuf 2019-03-05 06:50:57 -08:00 committed by GitHub
commit e2c17661b0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 5 deletions

View File

@ -55,10 +55,13 @@ func (p *kataBuiltInProxy) start(params proxyParams) (int, string, error) {
params.logger.Debug("Starting builtin kata proxy")
p.sandboxID = params.id
err := p.watchConsole(buildinProxyConsoleProto, params.consoleURL, params.logger)
if err != nil {
p.sandboxID = ""
return -1, "", err
if params.debug {
err := p.watchConsole(buildinProxyConsoleProto, params.consoleURL, params.logger)
if err != nil {
p.sandboxID = ""
return -1, "", err
}
}
return -1, params.agentURL, nil

View File

@ -17,7 +17,7 @@ func TestKataBuiltinProxy(t *testing.T) {
p := kataBuiltInProxy{}
params := proxyParams{}
params := proxyParams{debug: true}
err := p.validateParams(params)
assert.NotNil(err)