Delete bundle dir on restore if we're not debugging the shim
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
This commit is contained in:
parent
93395c0b1d
commit
9d251cbd1b
@ -364,7 +364,10 @@ func (r *Runtime) loadTasks(ctx context.Context, ns string) ([]*Task, error) {
|
|||||||
func (r *Runtime) cleanupAfterDeadShim(ctx context.Context, bundle *bundle, ns, id string, pid int, ec chan runc.Exit) error {
|
func (r *Runtime) cleanupAfterDeadShim(ctx context.Context, bundle *bundle, ns, id string, pid int, ec chan runc.Exit) error {
|
||||||
ctx = namespaces.WithNamespace(ctx, ns)
|
ctx = namespaces.WithNamespace(ctx, ns)
|
||||||
if err := r.terminate(ctx, bundle, ns, id); err != nil {
|
if err := r.terminate(ctx, bundle, ns, id); err != nil {
|
||||||
return errors.New("failed to terminate task, leaving bundle for debugging")
|
if r.config.ShimDebug {
|
||||||
|
return errors.Wrap(err, "failed to terminate task, leaving bundle for debugging")
|
||||||
|
}
|
||||||
|
log.G(ctx).WithError(err).Warn("failed to terminate task")
|
||||||
}
|
}
|
||||||
|
|
||||||
if ec != nil {
|
if ec != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user