Populate pod metadata in pod list and status APIs

Signed-off-by: Mrunal Patel <mrunalp@gmail.com>
This commit is contained in:
Mrunal Patel 2016-10-06 16:51:13 -07:00
parent 9b42de99d1
commit d1198fc75b

View file

@ -25,6 +25,7 @@ type sandbox struct {
containers oci.Store containers oci.Store
processLabel string processLabel string
mountLabel string mountLabel string
metadata *pb.PodSandboxMetadata
} }
const ( const (
@ -165,6 +166,7 @@ func (s *Server) RunPodSandbox(ctx context.Context, req *pb.RunPodSandboxRequest
containers: oci.NewMemoryStore(), containers: oci.NewMemoryStore(),
processLabel: processLabel, processLabel: processLabel,
mountLabel: mountLabel, mountLabel: mountLabel,
metadata: req.GetConfig().GetMetadata(),
}) })
for k, v := range annotations { for k, v := range annotations {
@ -413,8 +415,11 @@ func (s *Server) PodSandboxStatus(ctx context.Context, req *pb.PodSandboxStatusR
Network: sPtr(netNsPath), Network: sPtr(netNsPath),
}, },
}, },
Network: &pb.PodSandboxNetworkStatus{Ip: &ip}, Network: &pb.PodSandboxNetworkStatus{Ip: &ip},
State: &rStatus, State: &rStatus,
Labels: sb.labels,
Annotations: sb.annotations,
Metadata: sb.metadata,
}, },
}, nil }, nil
} }
@ -441,9 +446,12 @@ func (s *Server) ListPodSandbox(context.Context, *pb.ListPodSandboxRequest) (*pb
} }
pod := &pb.PodSandbox{ pod := &pb.PodSandbox{
Id: &sb.id, Id: &sb.id,
CreatedAt: int64Ptr(created), CreatedAt: int64Ptr(created),
State: &rStatus, State: &rStatus,
Labels: sb.labels,
Annotations: sb.annotations,
Metadata: sb.metadata,
} }
pods = append(pods, pod) pods = append(pods, pod)