From caac68c09f084bc7b19e2f1aff5dd975c256a388 Mon Sep 17 00:00:00 2001 From: Jose Carlos Venegas Munoz Date: Thu, 15 Aug 2019 17:31:19 -0500 Subject: [PATCH] sandbox: cgroup: prefix cgroup related methods rename to allow group in auto-generated docs. Signed-off-by: Jose Carlos Venegas Munoz --- virtcontainers/cgroups_test.go | 12 ++++++------ virtcontainers/sandbox.go | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/virtcontainers/cgroups_test.go b/virtcontainers/cgroups_test.go index 361cb066a3..9c8dc691fb 100644 --- a/virtcontainers/cgroups_test.go +++ b/virtcontainers/cgroups_test.go @@ -133,12 +133,12 @@ func TestUpdateCgroups(t *testing.T) { } // empty path - err := s.updateCgroups() + err := s.cgroupsUpdate() assert.NoError(err) // path doesn't exist s.state.CgroupPath = "/abc/123/rgb" - err = s.updateCgroups() + err = s.cgroupsUpdate() assert.Error(err) if os.Getuid() != 0 { @@ -152,7 +152,7 @@ func TestUpdateCgroups(t *testing.T) { s.hypervisor = &mockHypervisor{mockPid: 0} // bad pid - err = s.updateCgroups() + err = s.cgroupsUpdate() assert.Error(err) // fake workload @@ -161,7 +161,7 @@ func TestUpdateCgroups(t *testing.T) { s.hypervisor = &mockHypervisor{mockPid: cmd.Process.Pid} // no containers - err = s.updateCgroups() + err = s.cgroupsUpdate() assert.NoError(err) s.config = &SandboxConfig{} @@ -186,11 +186,11 @@ func TestUpdateCgroups(t *testing.T) { }, } - err = s.updateCgroups() + err = s.cgroupsUpdate() assert.NoError(err) // cleanup assert.NoError(cmd.Process.Kill()) - err = s.deleteCgroups() + err = s.cgroupsDelete() assert.NoError(err) } diff --git a/virtcontainers/sandbox.go b/virtcontainers/sandbox.go index 00792c77f6..b28f14efdd 100644 --- a/virtcontainers/sandbox.go +++ b/virtcontainers/sandbox.go @@ -758,7 +758,7 @@ func (s *Sandbox) Delete() error { } } - if err := s.deleteCgroups(); err != nil { + if err := s.cgroupsDelete(); err != nil { return err } @@ -1148,7 +1148,7 @@ func (s *Sandbox) CreateContainer(contConfig ContainerConfig) (VCContainer, erro return nil, err } - if err = s.updateCgroups(); err != nil { + if err = s.cgroupsUpdate(); err != nil { return nil, err } @@ -1325,7 +1325,7 @@ func (s *Sandbox) UpdateContainer(containerID string, resources specs.LinuxResou return err } - if err := s.updateCgroups(); err != nil { + if err := s.cgroupsUpdate(); err != nil { return err } @@ -1416,7 +1416,7 @@ func (s *Sandbox) createContainers() error { } } - if err := s.updateCgroups(); err != nil { + if err := s.cgroupsUpdate(); err != nil { return err } if err := s.storeSandbox(); err != nil { @@ -1876,7 +1876,7 @@ func (s *Sandbox) GetHypervisorType() string { return string(s.config.HypervisorType) } -func (s *Sandbox) updateCgroups() error { +func (s *Sandbox) cgroupsUpdate() error { if s.state.CgroupPath == "" { s.Logger().Warn("sandbox's cgroup won't be updated: cgroup path is empty") return nil @@ -1908,7 +1908,7 @@ func (s *Sandbox) updateCgroups() error { return nil } -func (s *Sandbox) deleteCgroups() error { +func (s *Sandbox) cgroupsDelete() error { s.Logger().Debug("Deleting sandbox cgroup") path := cgroupNoConstraintsPath(s.state.CgroupPath)