server: store creation in containers
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
This commit is contained in:
parent
1f4a4742cb
commit
790c6d891a
6 changed files with 28 additions and 15 deletions
|
@ -139,7 +139,12 @@ func (s *Server) loadContainer(id string) error {
|
|||
return err
|
||||
}
|
||||
|
||||
ctr, err := oci.NewContainer(id, name, containerPath, m.Annotations["crio/log_path"], sb.netNs(), labels, annotations, img, &metadata, sb.id, tty, sb.privileged, containerDir)
|
||||
created, err := time.Parse(time.RFC3339Nano, m.Annotations["crio/created"])
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
ctr, err := oci.NewContainer(id, name, containerPath, m.Annotations["crio/log_path"], sb.netNs(), labels, annotations, img, &metadata, sb.id, tty, sb.privileged, containerDir, created)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
@ -206,11 +211,6 @@ func (s *Server) loadSandbox(id string) error {
|
|||
|
||||
privileged := m.Annotations["crio/privileged_runtime"] == "true"
|
||||
|
||||
created, err := time.Parse(time.RFC3339Nano, m.Annotations["crio/created"])
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
sb := &sandbox{
|
||||
id: id,
|
||||
name: name,
|
||||
|
@ -225,7 +225,6 @@ func (s *Server) loadSandbox(id string) error {
|
|||
shmPath: m.Annotations["crio/shm_path"],
|
||||
privileged: privileged,
|
||||
resolvPath: m.Annotations["crio/resolv_path"],
|
||||
created: created,
|
||||
}
|
||||
|
||||
// We add a netNS only if we can load a permanent one.
|
||||
|
@ -271,7 +270,12 @@ func (s *Server) loadSandbox(id string) error {
|
|||
}
|
||||
}()
|
||||
|
||||
scontainer, err := oci.NewContainer(m.Annotations["crio/container_id"], cname, sandboxPath, m.Annotations["crio/log_path"], sb.netNs(), labels, annotations, nil, nil, id, false, privileged, sandboxDir)
|
||||
created, err := time.Parse(time.RFC3339Nano, m.Annotations["crio/created"])
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
scontainer, err := oci.NewContainer(m.Annotations["crio/container_id"], cname, sandboxPath, m.Annotations["crio/log_path"], sb.netNs(), labels, annotations, nil, nil, id, false, privileged, sandboxDir, created)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue