Improve container and sandbox status.

Signed-off-by: Lantao Liu <lantaol@google.com>
This commit is contained in:
Lantao Liu
2017-12-06 06:00:26 +00:00
parent 77a8ccb78e
commit b25b06577e
2 changed files with 54 additions and 44 deletions

View File

@@ -100,6 +100,7 @@ func toCRIContainerStatus(container containerstore.Container, spec *runtime.Imag
}
type containerInfo struct {
// TODO(random-liu): Add sandboxID in CRI container status.
SandboxID string `json:"sandboxID"`
Pid uint32 `json:"pid"`
Removing bool `json:"removing"`
@@ -115,7 +116,6 @@ func toCRIContainerInfo(ctx context.Context, container containerstore.Container,
return nil, nil
}
info := make(map[string]string)
meta := container.Metadata
status := container.Status.Get()
@@ -146,6 +146,7 @@ func toCRIContainerInfo(ctx context.Context, container containerstore.Container,
if err != nil {
return nil, fmt.Errorf("failed to marshal info %v: %v", ci, err)
}
info["info"] = string(infoBytes)
return info, nil
return map[string]string{
"info": string(infoBytes),
}, nil
}