mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-22 19:31:44 +00:00
update comments and owners file for pkg/util/removeall
This commit is contained in:
parent
484eb01822
commit
01bb0f86b0
8
pkg/util/removeall/OWNERS
Normal file
8
pkg/util/removeall/OWNERS
Normal file
@ -0,0 +1,8 @@
|
||||
# See the OWNERS docs at https://go.k8s.io/owners
|
||||
|
||||
approvers:
|
||||
- sig-storage-approvers
|
||||
reviewers:
|
||||
- sig-storage-reviewers
|
||||
labels:
|
||||
- sig/storage
|
@ -109,15 +109,20 @@ func RemoveAllOneFilesystemCommon(mounter mount.Interface, path string, remove f
|
||||
|
||||
// RemoveAllOneFilesystem removes the path and any children it contains, using
|
||||
// the os.Remove function. It makes sure it does not cross mount boundaries,
|
||||
// i.e. it does *not* remove files from another filesystem.
|
||||
// i.e. it returns an error rather than remove files from another filesystem.
|
||||
// It removes everything it can but returns the first error it encounters.
|
||||
// If the path does not exist, it returns nil (no error).
|
||||
func RemoveAllOneFilesystem(mounter mount.Interface, path string) error {
|
||||
return RemoveAllOneFilesystemCommon(mounter, path, os.Remove)
|
||||
}
|
||||
|
||||
// RemoveDirsOneFilesystem removes the path and any empty subdirectories it
|
||||
// contains, using the syscall.Rmdir function. Unlike RemoveAllOneFilesystem,
|
||||
// RemoveDirsOneFilesystem will remove only directories and fails if it
|
||||
// encounters any files in the directory tree.
|
||||
// RemoveDirsOneFilesystem will remove only directories and returns an error if
|
||||
// it encounters any files in the directory tree. It makes sure it does not
|
||||
// cross mount boundaries, i.e. it returns an error rather than remove dirs
|
||||
// from another filesystem. It removes everything it can but returns the first
|
||||
// error it encounters. If the path does not exist, it returns nil (no error).
|
||||
func RemoveDirsOneFilesystem(mounter mount.Interface, path string) error {
|
||||
return RemoveAllOneFilesystemCommon(mounter, path, syscall.Rmdir)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user