New oom sync (#257)
* Vendor in runc afaa21f79ade3b2e99a68f3f15e7219155aa4662 This updates the Dockerfile to use go 1.6.2 and install pkg-config are both are now needed by runc. Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com> * Add support for runc create/start operation Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com> * Remove dependency on runc state directory for OOM handler Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com> * Add OOM test Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
This commit is contained in:
committed by
Michael Crosby
parent
cf554d59dd
commit
8040df4e89
@@ -4,6 +4,7 @@ import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"sort"
|
||||
@@ -13,6 +14,11 @@ import (
|
||||
"golang.org/x/net/context"
|
||||
)
|
||||
|
||||
func (cs *ContainerdSuite) GetLogs() string {
|
||||
b, _ := ioutil.ReadFile(cs.logFile.Name())
|
||||
return string(b)
|
||||
}
|
||||
|
||||
func (cs *ContainerdSuite) ListRunningContainers() ([]*types.Container, error) {
|
||||
resp, err := cs.grpcClient.State(context.Background(), &types.StateRequest{})
|
||||
if err != nil {
|
||||
@@ -38,6 +44,16 @@ func (cs *ContainerdSuite) KillContainer(id string) error {
|
||||
return cs.SignalContainerProcess(id, "init", uint32(syscall.SIGKILL))
|
||||
}
|
||||
|
||||
func (cs *ContainerdSuite) UpdateContainerResource(id string, rs *types.UpdateResource) error {
|
||||
_, err := cs.grpcClient.UpdateContainer(context.Background(), &types.UpdateContainerRequest{
|
||||
Id: id,
|
||||
Pid: "init",
|
||||
Status: "",
|
||||
Resources: rs,
|
||||
})
|
||||
return err
|
||||
}
|
||||
|
||||
func (cs *ContainerdSuite) PauseContainer(id string) error {
|
||||
_, err := cs.grpcClient.UpdateContainer(context.Background(), &types.UpdateContainerRequest{
|
||||
Id: id,
|
||||
|
||||
Reference in New Issue
Block a user