diff options
author | Fabricio Voznika <fvoznika@google.com> | 2018-10-09 21:06:18 -0700 |
---|---|---|
committer | Shentubot <shentubot@google.com> | 2018-10-09 21:07:14 -0700 |
commit | 20508bafb88d2037ea3b2c8483b191ce72e7ad7e (patch) | |
tree | 7713850d594c45cd8e577dc582cb1771c6d4e6de /runsc/container | |
parent | c36d2ef3733a0619b992f8ddc23b072474b04044 (diff) |
Add tests to verify gofer is chroot'ed
PiperOrigin-RevId: 216472439
Change-Id: Ic4cb86c8e0a9cb022d3ceed9dc5615266c307cf9
Diffstat (limited to 'runsc/container')
-rw-r--r-- | runsc/container/container.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/runsc/container/container.go b/runsc/container/container.go index 827528349..f0cdee8d3 100644 --- a/runsc/container/container.go +++ b/runsc/container/container.go @@ -316,7 +316,7 @@ func Create(id string, spec *specs.Spec, conf *boot.Config, bundleDir, consoleSo // Write the PID file. Containerd considers the create complete after // this file is created, so it must be the last thing we do. if pidFile != "" { - if err := ioutil.WriteFile(pidFile, []byte(strconv.Itoa(c.Pid())), 0644); err != nil { + if err := ioutil.WriteFile(pidFile, []byte(strconv.Itoa(c.SandboxPid())), 0644); err != nil { c.Destroy() return nil, fmt.Errorf("error writing PID file: %v", err) } @@ -426,9 +426,9 @@ func (c *Container) Event() (*boot.Event, error) { return c.Sandbox.Event(c.ID) } -// Pid returns the Pid of the sandbox the container is running in, or -1 if the +// SandboxPid returns the Pid of the sandbox the container is running in, or -1 if the // container is not running. -func (c *Container) Pid() int { +func (c *Container) SandboxPid() int { if err := c.requireStatus("get PID", Created, Running, Paused); err != nil { return -1 } @@ -566,7 +566,7 @@ func (c *Container) State() specs.State { Version: specs.Version, ID: c.ID, Status: c.Status.String(), - Pid: c.Pid(), + Pid: c.SandboxPid(), Bundle: c.BundleDir, } } |