dockershim: bug fixes and more unit tests

Fixing the name triming and other small bugs. Added sandbox listing unit tests.
This commit is contained in:
Yu-Ju Hong
2016-08-26 16:15:06 -07:00
parent 115855bbd2
commit a1833d1947
5 changed files with 64 additions and 27 deletions

View File

@@ -62,7 +62,8 @@ func (ds *dockerService) ListContainers(filter *runtimeApi.ContainerFilter) ([]*
}
// Convert docker to runtime api containers.
result := []*runtimeApi.Container{}
for _, c := range containers {
for i := range containers {
c := containers[i]
if len(filter.GetName()) > 0 {
_, _, _, containerName, _, err := parseContainerName(c.Names[0])
if err != nil || containerName != filter.GetName() {