updated cadvisor to latest version; updated aws dependency to same as cadvisor

This commit is contained in:
David Ashpole
2017-01-18 10:55:35 -08:00
parent 6dfe5c49f6
commit 9737b41189
98 changed files with 63497 additions and 99685 deletions

View File

@@ -141,17 +141,21 @@ func ContainerNameToDockerId(name string) string {
return id
}
// isContainerName returns true if the cgroup with associated name
// corresponds to a docker container.
func isContainerName(name string) bool {
// always ignore .mount cgroup even if associated with docker and delegate to systemd
if strings.HasSuffix(name, ".mount") {
return false
}
return dockerCgroupRegexp.MatchString(path.Base(name))
}
// Docker handles all containers under /docker
func (self *dockerFactory) CanHandleAndAccept(name string) (bool, bool, error) {
// docker factory accepts all containers it can handle.
canAccept := true
// if the container is not associated with docker, we can't handle it or accept it.
if !isContainerName(name) {
return false, canAccept, fmt.Errorf("invalid container name")
return false, false, nil
}
// Check if the container is known to docker and it is active.
@@ -160,10 +164,10 @@ func (self *dockerFactory) CanHandleAndAccept(name string) (bool, bool, error) {
// We assume that if Inspect fails then the container is not known to docker.
ctnr, err := self.client.ContainerInspect(context.Background(), id)
if err != nil || !ctnr.State.Running {
return false, canAccept, fmt.Errorf("error inspecting container: %v", err)
return false, true, fmt.Errorf("error inspecting container: %v", err)
}
return true, canAccept, nil
return true, true, nil
}
func (self *dockerFactory) DebugInfo() map[string][]string {