server: containers restore

Signed-off-by: Antonio Murdaca <runcom@redhat.com>
This commit is contained in:
Antonio Murdaca 2016-10-07 16:20:04 +02:00
parent cc732301ac
commit 54d6ddb5af
No known key found for this signature in database
GPG key ID: B2BEAD150DE936B9
3 changed files with 99 additions and 15 deletions

View file

@ -173,6 +173,7 @@ func (s *Server) RunPodSandbox(ctx context.Context, req *pb.RunPodSandboxRequest
if err != nil {
return nil, err
}
g.SetProcessSelinuxLabel(processLabel)
}
containerID, containerName, err := s.generateContainerIDandName(name, "infra", 0)
@ -355,6 +356,10 @@ func (s *Server) RemovePodSandbox(ctx context.Context, req *pb.RemovePodSandboxR
s.removeContainer(c)
}
if err := label.UnreserveLabel(sb.processLabel); err != nil {
return nil, err
}
// Remove the files related to the sandbox
podSandboxDir := filepath.Join(s.sandboxDir, sb.id)
if err := os.RemoveAll(podSandboxDir); err != nil {