From e661be6a9ca832a71aa06eedda3d77da02d2d55c Mon Sep 17 00:00:00 2001 From: Kenfe-Mickael Laventure Date: Thu, 10 Aug 2017 16:49:01 -0700 Subject: [PATCH] Fix failure to connect to shim on daemon restart Signed-off-by: Kenfe-Mickael Laventure --- linux/bundle.go | 3 ++- linux/runtime.go | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/linux/bundle.go b/linux/bundle.go index 66c0cb483..b03dc8733 100644 --- a/linux/bundle.go +++ b/linux/bundle.go @@ -17,10 +17,11 @@ import ( "github.com/pkg/errors" ) -func loadBundle(path, workdir, namespace string, events *events.Exchange) *bundle { +func loadBundle(path, workdir, namespace, id string, events *events.Exchange) *bundle { return &bundle{ path: path, namespace: namespace, + id: id, events: events, workDir: workdir, } diff --git a/linux/runtime.go b/linux/runtime.go index 0430c6943..e8a52c960 100644 --- a/linux/runtime.go +++ b/linux/runtime.go @@ -215,6 +215,7 @@ func (r *Runtime) Delete(ctx context.Context, c runtime.Task) (*runtime.Exit, er filepath.Join(r.state, namespace, lc.id), filepath.Join(r.root, namespace, lc.id), namespace, + lc.id, r.events, ) if err := bundle.Delete(); err != nil { @@ -267,7 +268,8 @@ func (r *Runtime) loadTasks(ctx context.Context, ns string) ([]*Task, error) { continue } id := path.Name() - bundle := loadBundle(filepath.Join(r.state, ns, id), filepath.Join(r.root, ns, id), ns, r.events) + bundle := loadBundle(filepath.Join(r.state, ns, id), + filepath.Join(r.root, ns, id), ns, id, r.events) s, err := bundle.Connect(ctx, r.remote) if err != nil {