mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-08-15 06:34:03 +00:00
container: on cleanup, rm container directory for mounts path
A wrong path was being used for container directory when virtiofs is utilized. This resulted in a warning message in logs when a container is killed, or completes: level=warning msg="Could not remove container share dir" Without proper removal, they'd later be cleaned up when the shared path is removed as part of stopping the sandbox. Fixes: #1559 Signed-off-by: Eric Ernst <eric.g.ernst@gmail.com>
This commit is contained in:
parent
594c47ab6c
commit
9a4e866654
@ -1047,7 +1047,7 @@ func (c *Container) stop(ctx context.Context, force bool) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
shareDir := filepath.Join(kataHostSharedDir(), c.sandbox.id, c.id)
|
shareDir := filepath.Join(getMountPath(c.sandbox.id), c.id)
|
||||||
if err := syscall.Rmdir(shareDir); err != nil {
|
if err := syscall.Rmdir(shareDir); err != nil {
|
||||||
c.Logger().WithError(err).WithField("share-dir", shareDir).Warn("Could not remove container share dir")
|
c.Logger().WithError(err).WithField("share-dir", shareDir).Warn("Could not remove container share dir")
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user