store annotations and image for a container
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
This commit is contained in:
parent
5142b8a4d7
commit
430297dd81
6 changed files with 66 additions and 33 deletions
|
@ -79,7 +79,20 @@ func (s *Server) loadContainer(id string) error {
|
|||
}
|
||||
containerPath := filepath.Join(s.runtime.ContainerDir(), id)
|
||||
|
||||
ctr, err := oci.NewContainer(id, name, containerPath, m.Annotations["ocid/log_path"], labels, &metadata, sb.id, tty)
|
||||
var img *pb.ImageSpec
|
||||
image, ok := m.Annotations["ocid/image"]
|
||||
if ok {
|
||||
img = &pb.ImageSpec{
|
||||
Image: &image,
|
||||
}
|
||||
}
|
||||
|
||||
annotations := make(map[string]string)
|
||||
if err = json.Unmarshal([]byte(m.Annotations["ocid/annotations"]), &annotations); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
ctr, err := oci.NewContainer(id, name, containerPath, m.Annotations["ocid/log_path"], labels, annotations, img, &metadata, sb.id, tty)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
@ -150,7 +163,7 @@ func (s *Server) loadSandbox(id string) error {
|
|||
if err != nil {
|
||||
return err
|
||||
}
|
||||
scontainer, err := oci.NewContainer(m.Annotations["ocid/container_id"], cname, sandboxPath, sandboxPath, labels, nil, id, false)
|
||||
scontainer, err := oci.NewContainer(m.Annotations["ocid/container_id"], cname, sandboxPath, sandboxPath, labels, annotations, nil, nil, id, false)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue