Skip to content
This repository has been archived by the owner on May 12, 2021. It is now read-only.

Commit

Permalink
container: SandboxCgroupOnly: no host cgroups.
Browse files Browse the repository at this point in the history
No call cgroup operations for containers in host
if SandboxCgroupOnly is enabled.

Signed-off-by: Jose Carlos Venegas Munoz <[email protected]>
  • Loading branch information
jcvenegas committed Aug 29, 2019
1 parent b650632 commit 2fcb8bb
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions virtcontainers/container.go
Original file line number Diff line number Diff line change
Expand Up @@ -879,8 +879,10 @@ func (c *Container) create() (err error) {
}
c.process = *process

if err = c.cgroupsCreate(); err != nil {
return
if !c.sandbox.config.SandboxCgroupOnly {
if err = c.cgroupsCreate(); err != nil {
return
}
}

if !c.sandbox.supportNewStore() {
Expand Down Expand Up @@ -908,8 +910,10 @@ func (c *Container) delete() error {
return err
}

if err := c.cgroupsDelete(); err != nil {
return err
if !c.sandbox.config.SandboxCgroupOnly {
if err := c.cgroupsDelete(); err != nil {
return err
}
}

return c.store.Delete()
Expand Down Expand Up @@ -1200,8 +1204,10 @@ func (c *Container) update(resources specs.LinuxResources) error {
return err
}

if err := c.cgroupsUpdate(resources); err != nil {
return err
if !c.sandbox.config.SandboxCgroupOnly {
if err := c.cgroupsUpdate(resources); err != nil {
return err
}
}

return c.sandbox.agent.updateContainer(c.sandbox, *c, resources)
Expand Down

0 comments on commit 2fcb8bb

Please sign in to comment.