server: restore sandbox created time from disk

Signed-off-by: Antonio Murdaca <runcom@redhat.com>
This commit is contained in:
Antonio Murdaca 2017-05-11 11:04:43 +02:00
parent a680b845ae
commit 1094ffa204
No known key found for this signature in database
GPG key ID: B2BEAD150DE936B9

View file

@ -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.