Fix restore to correctly set the exec timeout value (containerd)
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
This commit is contained in:
parent
7279ff91c4
commit
7979ac24fe
2 changed files with 3 additions and 2 deletions
|
@ -138,7 +138,7 @@ func New(opts ContainerOpts) (Container, error) {
|
||||||
return c, nil
|
return c, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func Load(root, id string) (Container, error) {
|
func Load(root, id string, timeout time.Duration) (Container, error) {
|
||||||
var s state
|
var s state
|
||||||
f, err := os.Open(filepath.Join(root, id, StateFile))
|
f, err := os.Open(filepath.Join(root, id, StateFile))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -158,6 +158,7 @@ func Load(root, id string) (Container, error) {
|
||||||
shim: s.Shim,
|
shim: s.Shim,
|
||||||
noPivotRoot: s.NoPivotRoot,
|
noPivotRoot: s.NoPivotRoot,
|
||||||
processes: make(map[string]*process),
|
processes: make(map[string]*process),
|
||||||
|
timeout: timeout,
|
||||||
}
|
}
|
||||||
dirs, err := ioutil.ReadDir(filepath.Join(root, id))
|
dirs, err := ioutil.ReadDir(filepath.Join(root, id))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
@ -305,7 +305,7 @@ func (s *Supervisor) restore() error {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
id := d.Name()
|
id := d.Name()
|
||||||
container, err := runtime.Load(s.stateDir, id)
|
container, err := runtime.Load(s.stateDir, id, s.timeout)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue