Windows: Remove GetPidsForContainer

Signed-off-by: John Howard <jhoward@microsoft.com>
This commit is contained in:
John Howard 2017-01-18 12:28:52 -08:00
parent f19a293dd7
commit f47e417466

View file

@ -564,23 +564,9 @@ func (clnt *client) Restore(containerID string, _ StdioCallback, unusedOnWindows
} }
// GetPidsForContainer returns a list of process IDs running in a container. // GetPidsForContainer returns a list of process IDs running in a container.
// Although implemented, this is not used in Windows. // Not used on Windows.
func (clnt *client) GetPidsForContainer(containerID string) ([]int, error) { func (clnt *client) GetPidsForContainer(containerID string) ([]int, error) {
var pids []int return nil, errors.New("not implemented on Windows")
clnt.lock(containerID)
defer clnt.unlock(containerID)
cont, err := clnt.getContainer(containerID)
if err != nil {
return nil, err
}
// Add the first process
pids = append(pids, int(cont.containerCommon.systemPid))
// And add all the exec'd processes
for _, p := range cont.processes {
pids = append(pids, int(p.processCommon.systemPid))
}
return pids, nil
} }
// Summary returns a summary of the processes running in a container. // Summary returns a summary of the processes running in a container.