proxy: decouple from sandbox

A proxy is mostly associated with an agent. Decouple it from sandbox
so that we can start it before linking vm with an actual sandbox.

Signed-off-by: Peng Tao <bergwolf@gmail.com>
This commit is contained in:
Peng Tao
2018-08-17 16:44:10 +08:00
parent f39fa5d489
commit 8f77c33d68
12 changed files with 177 additions and 130 deletions

View File

@@ -390,7 +390,11 @@ func (h *hyper) startProxy(sandbox *Sandbox) error {
}
// Start the proxy here
pid, uri, err := h.proxy.start(sandbox, proxyParams{})
pid, uri, err := h.proxy.start(proxyParams{
id: sandbox.id,
path: sandbox.config.ProxyConfig.Path,
logger: h.Logger(),
})
if err != nil {
return err
}
@@ -461,7 +465,7 @@ func (h *hyper) stopSandbox(sandbox *Sandbox) error {
return err
}
return h.proxy.stop(sandbox, h.state.ProxyPid)
return h.proxy.stop(h.state.ProxyPid)
}
// handleBlockVolumes handles volumes that are block device files, by