Fix failure to connect to shim on daemon restart
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
This commit is contained in:
parent
7ac351cdfe
commit
e661be6a9c
@ -17,10 +17,11 @@ import (
|
|||||||
"github.com/pkg/errors"
|
"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{
|
return &bundle{
|
||||||
path: path,
|
path: path,
|
||||||
namespace: namespace,
|
namespace: namespace,
|
||||||
|
id: id,
|
||||||
events: events,
|
events: events,
|
||||||
workDir: workdir,
|
workDir: workdir,
|
||||||
}
|
}
|
||||||
|
@ -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.state, namespace, lc.id),
|
||||||
filepath.Join(r.root, namespace, lc.id),
|
filepath.Join(r.root, namespace, lc.id),
|
||||||
namespace,
|
namespace,
|
||||||
|
lc.id,
|
||||||
r.events,
|
r.events,
|
||||||
)
|
)
|
||||||
if err := bundle.Delete(); err != nil {
|
if err := bundle.Delete(); err != nil {
|
||||||
@ -267,7 +268,8 @@ func (r *Runtime) loadTasks(ctx context.Context, ns string) ([]*Task, error) {
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
id := path.Name()
|
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)
|
s, err := bundle.Connect(ctx, r.remote)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user