Merge pull request #176 from gao-feng/hidden-infra-container

store infra container in sandbox
This commit is contained in:
Mrunal Patel 2016-10-25 03:25:17 +00:00 committed by GitHub
commit c89157e45c
3 changed files with 49 additions and 41 deletions

View file

@ -102,7 +102,8 @@ func (s *Server) loadSandbox(id string) error {
if err != nil {
return err
}
s.addSandbox(&sandbox{
sb := &sandbox{
id: id,
name: name,
logDir: m.Annotations["ocid/log_path"],
@ -110,7 +111,9 @@ func (s *Server) loadSandbox(id string) error {
containers: oci.NewMemoryStore(),
processLabel: processLabel,
mountLabel: mountLabel,
})
}
s.addSandbox(sb)
sandboxPath := filepath.Join(s.config.SandboxDir, id)
if err := label.ReserveLabel(processLabel); err != nil {
@ -125,7 +128,7 @@ func (s *Server) loadSandbox(id string) error {
if err != nil {
return err
}
s.addContainer(scontainer)
sb.infraContainer = scontainer
if err = s.runtime.UpdateStatus(scontainer); err != nil {
logrus.Warnf("error updating status for container %s: %v", scontainer.ID(), err)
}