From 54a022defbebb1a56bece0dfb5ea69a2b315f61c Mon Sep 17 00:00:00 2001 From: Crazykev Date: Tue, 1 Nov 2016 13:49:21 +0800 Subject: [PATCH] restore pod annotations when restart ocid Signed-off-by: Crazykev --- server/server.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/server/server.go b/server/server.go index 2f9accbb..1fa57250 100644 --- a/server/server.go +++ b/server/server.go @@ -103,6 +103,11 @@ func (s *Server) loadSandbox(id string) error { return err } + annotations := make(map[string]string) + if err = json.Unmarshal([]byte(m.Annotations["ocid/annotations"]), &annotations); err != nil { + return err + } + sb := &sandbox{ id: id, name: name, @@ -111,6 +116,7 @@ func (s *Server) loadSandbox(id string) error { containers: oci.NewMemoryStore(), processLabel: processLabel, mountLabel: mountLabel, + annotations: annotations, } s.addSandbox(sb)