server: restore sandbox created time from disk
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
This commit is contained in:
parent
a680b845ae
commit
1094ffa204
1 changed files with 6 additions and 0 deletions
|
@ -7,6 +7,7 @@ import (
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"sync"
|
"sync"
|
||||||
|
"time"
|
||||||
|
|
||||||
"github.com/Sirupsen/logrus"
|
"github.com/Sirupsen/logrus"
|
||||||
"github.com/containers/image/types"
|
"github.com/containers/image/types"
|
||||||
|
@ -199,6 +200,10 @@ func (s *Server) loadSandbox(id string) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
privileged := m.Annotations["ocid/privileged_runtime"] == "true"
|
privileged := m.Annotations["ocid/privileged_runtime"] == "true"
|
||||||
|
created, err := time.Parse(time.RFC3339Nano, m.Annotations["ocid/created"])
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
sb := &sandbox{
|
sb := &sandbox{
|
||||||
id: id,
|
id: id,
|
||||||
|
@ -214,6 +219,7 @@ func (s *Server) loadSandbox(id string) error {
|
||||||
shmPath: m.Annotations["ocid/shm_path"],
|
shmPath: m.Annotations["ocid/shm_path"],
|
||||||
privileged: privileged,
|
privileged: privileged,
|
||||||
resolvPath: m.Annotations["ocid/resolv_path"],
|
resolvPath: m.Annotations["ocid/resolv_path"],
|
||||||
|
created: created,
|
||||||
}
|
}
|
||||||
|
|
||||||
// We add a netNS only if we can load a permanent one.
|
// We add a netNS only if we can load a permanent one.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue