server/runtime: store sandbox id in container's annotations

Signed-off-by: Antonio Murdaca <runcom@redhat.com>
This commit is contained in:
Antonio Murdaca 2016-09-18 18:36:33 +02:00
parent caae4b298a
commit 260a7adb83
No known key found for this signature in database
GPG key ID: B2BEAD150DE936B9

View file

@ -44,10 +44,6 @@ func (s *Server) Version(ctx context.Context, req *pb.VersionRequest) (*pb.Versi
func (s *Server) CreatePodSandbox(ctx context.Context, req *pb.CreatePodSandboxRequest) (*pb.CreatePodSandboxResponse, error) {
var err error
if err := os.MkdirAll(s.sandboxDir, 0755); err != nil {
return nil, err
}
// process req.Name
name := req.GetConfig().GetMetadata().GetName()
if name == "" {
@ -440,6 +436,8 @@ func (s *Server) CreateContainer(ctx context.Context, req *pb.CreateContainerReq
}
}
specgen.AddAnnotation("pod_sandbox_id", podSandboxId)
if containerConfig.GetPrivileged() {
specgen.SetupPrivileged(true)
}