From d1198fc75b87315a618eba6df2e5f09784fb4fe8 Mon Sep 17 00:00:00 2001 From: Mrunal Patel Date: Thu, 6 Oct 2016 16:51:13 -0700 Subject: [PATCH] Populate pod metadata in pod list and status APIs Signed-off-by: Mrunal Patel --- server/sandbox.go | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/server/sandbox.go b/server/sandbox.go index fcaa411d..4eeb845d 100644 --- a/server/sandbox.go +++ b/server/sandbox.go @@ -25,6 +25,7 @@ type sandbox struct { containers oci.Store processLabel string mountLabel string + metadata *pb.PodSandboxMetadata } const ( @@ -165,6 +166,7 @@ func (s *Server) RunPodSandbox(ctx context.Context, req *pb.RunPodSandboxRequest containers: oci.NewMemoryStore(), processLabel: processLabel, mountLabel: mountLabel, + metadata: req.GetConfig().GetMetadata(), }) for k, v := range annotations { @@ -413,8 +415,11 @@ func (s *Server) PodSandboxStatus(ctx context.Context, req *pb.PodSandboxStatusR Network: sPtr(netNsPath), }, }, - Network: &pb.PodSandboxNetworkStatus{Ip: &ip}, - State: &rStatus, + Network: &pb.PodSandboxNetworkStatus{Ip: &ip}, + State: &rStatus, + Labels: sb.labels, + Annotations: sb.annotations, + Metadata: sb.metadata, }, }, nil } @@ -441,9 +446,12 @@ func (s *Server) ListPodSandbox(context.Context, *pb.ListPodSandboxRequest) (*pb } pod := &pb.PodSandbox{ - Id: &sb.id, - CreatedAt: int64Ptr(created), - State: &rStatus, + Id: &sb.id, + CreatedAt: int64Ptr(created), + State: &rStatus, + Labels: sb.labels, + Annotations: sb.annotations, + Metadata: sb.metadata, } pods = append(pods, pod)