Commit Graph

9 Commits

Author SHA1 Message Date
Eng Zer Jun
50da673592
refactor: move from io/ioutil to io and os package
The io/ioutil package has been deprecated as of Go 1.16, see
https://golang.org/doc/go1.16#ioutil. This commit replaces the existing
io/ioutil functions with their new definitions in io and os packages.

Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
2021-09-21 09:50:38 +08:00
Wei Fu
73b1449278 runtime: ignore ErrNotExist when remove rootfs
Signed-off-by: Wei Fu <fuweid89@gmail.com>
2020-08-12 20:04:50 +08:00
Michael Crosby
ed308ea1e6 Unmount rootfs with separate Remove() in bundle
This ensures that a container does not have a mounted rootfs in the
bundle directory before RemoveAll is called.  Having the rootfs removed
first with a Remove ensures that the directory is not mounted and empty
before the bundle directory is removed.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2019-06-05 20:37:35 +00:00
Michael Crosby
7531c66d5a Ensure that the rootfs dir is created in the bundle
This fixes issues running gvisor on top of containerd without docker.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2019-06-03 19:56:19 +00:00
Ace-Tang
5b7a327c47 Improve atomic delete
skip hidden directories in load task, and return soon if path not exist
in atomicDelete

carry of #3233

Closes #3233

Signed-off-by: Ace-Tang <aceapril@126.com>
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2019-05-20 20:13:35 +00:00
Georgi Sabev
c0f0b21314 Apply PR feedback
* Rootfs dir is created during container creation not during bundle
  creation
* Add support for v2
* UnmountAll is a no-op when the path to unmount (i.e. the rootfs dir)
  does not exist or is invalid

Co-authored-by: Danail Branekov <danailster@gmail.com>
Signed-off-by: Georgi Sabev <georgethebeatle@gmail.com>
2019-04-04 18:40:30 +03:00
Michael Crosby
36e4dc603e Ensure bundle removal is atomic
This makes bundle removal atomic by first renaming the bundle and
working directories to a hidden path before removing the underlying
directories.

Closes #2567
Closes #2327

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2018-12-20 13:45:18 -05:00
Michael Crosby
ac78a5b615 Remove and create workdir if state dir does not exist
This is the case where the work dir could still exist if a machine
reboots, reseting the state dir.  On container creation, we should just
clear out the work dir.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2018-08-27 18:18:50 -04:00
Michael Crosby
da1b5470cd Runtime v2
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2018-07-17 10:21:29 -04:00