| 151 | } |
| 152 | |
| 153 | func containerToProto(container *containers.Container) *containersapi.Container { |
| 154 | extensions := make(map[string]*ptypes.Any) |
| 155 | for k, v := range container.Extensions { |
| 156 | extensions[k] = typeurl.MarshalProto(v) |
| 157 | } |
| 158 | return &containersapi.Container{ |
| 159 | ID: container.ID, |
| 160 | Labels: container.Labels, |
| 161 | Image: container.Image, |
| 162 | Runtime: &containersapi.Container_Runtime{ |
| 163 | Name: container.Runtime.Name, |
| 164 | Options: typeurl.MarshalProto(container.Runtime.Options), |
| 165 | }, |
| 166 | Spec: typeurl.MarshalProto(container.Spec), |
| 167 | Snapshotter: container.Snapshotter, |
| 168 | SnapshotKey: container.SnapshotKey, |
| 169 | Extensions: extensions, |
| 170 | Sandbox: container.SandboxID, |
| 171 | } |
| 172 | } |
| 173 | |
| 174 | func containerFromProto(containerpb *containersapi.Container) containers.Container { |
| 175 | var runtime containers.RuntimeInfo |