Fix failure to connect to shim on daemon restart

Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
This commit is contained in:
Kenfe-Mickael Laventure 2017-08-10 16:49:01 -07:00
parent 7ac351cdfe
commit e661be6a9c
No known key found for this signature in database
GPG Key ID: 40CF16616B361216
2 changed files with 5 additions and 2 deletions

View File

@ -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,
}

View File

@ -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 {