container: Add image ID and name to the container status
Kubelet 1.6 seems to request that those fields must be present. Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
This commit is contained in:
parent
792f585c44
commit
0169dce585
1 changed files with 10 additions and 1 deletions
|
@ -16,18 +16,27 @@ func (s *Server) ContainerStatus(ctx context.Context, req *pb.ContainerStatusReq
|
|||
return nil, err
|
||||
}
|
||||
|
||||
if err := s.runtime.UpdateStatus(c); err != nil {
|
||||
if err = s.runtime.UpdateStatus(c); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
containerID := c.ID()
|
||||
image := c.Image()
|
||||
resp := &pb.ContainerStatusResponse{
|
||||
Status: &pb.ContainerStatus{
|
||||
Id: containerID,
|
||||
Metadata: c.Metadata(),
|
||||
Image: image,
|
||||
},
|
||||
}
|
||||
|
||||
status, err := s.images.ImageStatus(s.imageContext, image.Image)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
resp.Status.ImageRef = status.ID
|
||||
|
||||
cState := s.runtime.ContainerStatus(c)
|
||||
rStatus := pb.ContainerState_CONTAINER_UNKNOWN
|
||||
|
||||
|
|
Loading…
Reference in a new issue