cmd/ctr, service/containers: implement container filter

Signed-off-by: Stephen J Day <stephen.day@docker.com>
This commit is contained in:
Stephen J Day
2017-06-21 15:29:58 -07:00
parent 3332042ab6
commit 396d89e423
16 changed files with 409 additions and 189 deletions

View File

@@ -35,15 +35,25 @@ func containerToProto(container *containers.Container) api.Container {
}
func containerFromProto(containerpb *api.Container) containers.Container {
return containers.Container{
ID: containerpb.ID,
Labels: containerpb.Labels,
Image: containerpb.Image,
Runtime: containers.RuntimeInfo{
var runtime containers.RuntimeInfo
if containerpb.Runtime != nil {
runtime = containers.RuntimeInfo{
Name: containerpb.Runtime.Name,
Options: containerpb.Runtime.Options,
},
Spec: containerpb.Spec.Value,
RootFS: containerpb.RootFS,
}
}
var spec []byte
if containerpb.Spec != nil {
spec = containerpb.Spec.Value
}
return containers.Container{
ID: containerpb.ID,
Labels: containerpb.Labels,
Image: containerpb.Image,
Runtime: runtime,
Spec: spec,
RootFS: containerpb.RootFS,
}
}