Set OnClose shim function

When restoring a task make sure that dead shims are handled.

Fixes #2078

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
Michael Crosby
2018-02-06 10:45:50 -05:00
parent 9745a4d448
commit 87d15a5ffc
3 changed files with 18 additions and 6 deletions

View File

@@ -84,9 +84,9 @@ func ShimLocal(exchange *exchange.Exchange) ShimOpt {
}
// ShimConnect is a ShimOpt for connecting to an existing remote shim
func ShimConnect() ShimOpt {
func ShimConnect(onClose func()) ShimOpt {
return func(b *bundle, ns string, ropts *runctypes.RuncOptions) (shim.Config, client.Opt) {
return b.shimConfig(ns, ropts), client.WithConnect(b.shimAddress(ns))
return b.shimConfig(ns, ropts), client.WithConnect(b.shimAddress(ns), onClose)
}
}