remove dead code
This commit is contained in:
parent
13674cf06c
commit
9931854585
@ -131,16 +131,6 @@ func ContainerNameToDockerId(name string) string {
|
||||
return id
|
||||
}
|
||||
|
||||
// Returns a full container name for the specified Docker ID.
|
||||
func FullContainerName(dockerId string) string {
|
||||
// Add the full container name.
|
||||
if UseSystemd() {
|
||||
return path.Join("/system.slice", fmt.Sprintf("docker-%s.scope", dockerId))
|
||||
} else {
|
||||
return path.Join("/docker", dockerId)
|
||||
}
|
||||
}
|
||||
|
||||
// Docker handles all containers under /docker
|
||||
func (self *dockerFactory) CanHandleAndAccept(name string) (bool, bool, error) {
|
||||
// docker factory accepts all containers it can handle.
|
||||
|
@ -294,32 +294,8 @@ func (self *dockerContainerHandler) GetStats() (*info.ContainerStats, error) {
|
||||
}
|
||||
|
||||
func (self *dockerContainerHandler) ListContainers(listType container.ListType) ([]info.ContainerReference, error) {
|
||||
if self.name != "/docker" {
|
||||
return []info.ContainerReference{}, nil
|
||||
}
|
||||
opt := docker.ListContainersOptions{
|
||||
All: true,
|
||||
}
|
||||
containers, err := self.client.ListContainers(opt)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
ret := make([]info.ContainerReference, 0, len(containers)+1)
|
||||
for _, c := range containers {
|
||||
if !strings.HasPrefix(c.Status, "Up ") {
|
||||
continue
|
||||
}
|
||||
|
||||
ref := info.ContainerReference{
|
||||
Name: FullContainerName(c.ID),
|
||||
Aliases: append(c.Names, c.ID),
|
||||
Namespace: DockerNamespace,
|
||||
}
|
||||
ret = append(ret, ref)
|
||||
}
|
||||
|
||||
return ret, nil
|
||||
// No-op for Docker driver.
|
||||
return []info.ContainerReference{}, nil
|
||||
}
|
||||
|
||||
func (self *dockerContainerHandler) GetCgroupPath(resource string) (string, error) {
|
||||
|
Loading…
Reference in New Issue
Block a user