proxy: Pass sandbox to proxy

Add the `-sandbox` option when launching the proxy. This isn't strictly
required by the proxy, but is extremely useful for log analysis to allow
log entries to be matched to sandboxes as the proxy will add a
`sandbox` field in each log entry.

Fixes #463.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
This commit is contained in:
James O. D. Hunt 2018-07-04 12:01:14 +01:00
parent b2bec3362b
commit 23eb13f23a

View File

@ -43,7 +43,13 @@ func (p *kataProxy) start(sandbox *Sandbox, params proxyParams) (int, string, er
return -1, "", err return -1, "", err
} }
args := []string{config.Path, "-listen-socket", proxyURL, "-mux-socket", params.agentURL} args := []string{
config.Path,
"-listen-socket", proxyURL,
"-mux-socket", params.agentURL,
"-sandbox", sandbox.ID(),
}
if config.Debug { if config.Debug {
args = append(args, "-log", "debug") args = append(args, "-log", "debug")
console, err := sandbox.hypervisor.getSandboxConsole(sandbox.id) console, err := sandbox.hypervisor.getSandboxConsole(sandbox.id)