update cadvisor godeps

This commit is contained in:
David Ashpole
2017-06-01 17:10:37 -07:00
parent 3837d95191
commit 066d61ce0a
96 changed files with 5879 additions and 1693 deletions

View File

@@ -566,9 +566,24 @@ func (self *manager) getDockerContainer(containerName string) (*containerData, e
Namespace: docker.DockerNamespace,
Name: containerName,
}]
// Look for container by short prefix name if no exact match found.
if !ok {
return nil, fmt.Errorf("unable to find Docker container %q", containerName)
for contName, c := range self.containers {
if contName.Namespace == docker.DockerNamespace && strings.HasPrefix(contName.Name, containerName) {
if cont == nil {
cont = c
} else {
return nil, fmt.Errorf("unable to find container. Container %q is not unique", containerName)
}
}
}
if cont == nil {
return nil, fmt.Errorf("unable to find Docker container %q", containerName)
}
}
return cont, nil
}