CRI: implement Controller.Delete for SandboxAPI

Signed-off-by: WangLei <wllenyj@linux.alibaba.com>
This commit is contained in:
wanglei01
2022-09-30 16:20:05 +08:00
parent 1cc38f8df7
commit a59ecc50e3
5 changed files with 74 additions and 36 deletions

View File

@@ -65,6 +65,18 @@ func getCgroupsPath(cgroupsParent, id string) string {
return filepath.Join(cgroupsParent, id)
}
// getSandboxRootDir returns the root directory for managing sandbox files,
// e.g. hosts files.
func (c *criService) getSandboxRootDir(id string) string {
return filepath.Join(c.config.RootDir, sandboxesDir, id)
}
// getVolatileSandboxRootDir returns the root directory for managing volatile sandbox files,
// e.g. named pipes.
func (c *criService) getVolatileSandboxRootDir(id string) string {
return filepath.Join(c.config.StateDir, sandboxesDir, id)
}
// getSandboxHostname returns the hostname file path inside the sandbox root directory.
func (c *criService) getSandboxHostname(id string) string {
return filepath.Join(c.getSandboxRootDir(id), "hostname")