Skip to content
This repository was archived by the owner on Feb 8, 2021. It is now read-only.

Commit b4e91ad

Browse files
committed
enable save/load sandbox
Signed-off-by: fupan <lifupan@gmail.com>
1 parent 8b8b045 commit b4e91ad

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

daemon/pod/persist.go

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -449,7 +449,7 @@ func (inf *Interface) removeFromDB() error {
449449
}
450450

451451
func (p *XPod) saveSandbox() error {
452-
/*
452+
453453
var (
454454
sb types.SandboxPersistInfo
455455
err error
@@ -464,15 +464,18 @@ func (p *XPod) saveSandbox() error {
464464
defer p.statusLock.RUnlock()
465465
if !stop_status[p.status] {
466466
sb.Id = p.sandbox.ID()
467-
sb.PersistInfo, err = p.sandbox.Dump()
467+
/*By now the sandbox info had been managed by kata, thus there is no need
468+
*to keep those info here.
469+
*/
470+
sb.PersistInfo = nil
468471
if err != nil {
469472
hlog.HLog(ERROR, p, 2, "failed to dump sandbox %s: %v", sb.Id, err)
470473
return err
471474
}
472475
return saveMessage(p.factory.db, fmt.Sprintf(SB_KEY_FMT, p.Id()), &sb, p, "sandbox info")
473476

474477
}
475-
*/
478+
476479
return nil
477480
}
478481

daemon/pod/sandbox.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,6 @@ func dissociateSandbox(sandbox *vc.Sandbox, retry int) error {
9393
if err != nil {
9494
hlog.Log(WARNING, "SB[%s] failed to release sandbox: %v", sandbox.ID(), err)
9595
hlog.Log(INFO, "SB[%s] shutdown because of failed release", sandbox.ID())
96-
sandbox.Delete()
9796
_, err = vc.StopSandbox(sandbox.ID())
9897
return err
9998
}

0 commit comments

Comments
 (0)