Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
a2306e8c
Commit
a2306e8c
authored
Dec 26, 2018
by
Michelle Au
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add comments around use of PathExists
parent
2cba4e37
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
0 deletions
+3
-0
mount_helper.go
pkg/util/mount/mount_helper.go
+3
-0
No files found.
pkg/util/mount/mount_helper.go
View file @
a2306e8c
...
@@ -36,6 +36,8 @@ func UnmountPath(mountPath string, mounter Interface) error {
...
@@ -36,6 +36,8 @@ func UnmountPath(mountPath string, mounter Interface) error {
// IsNotMountPoint will be called instead of IsLikelyNotMountPoint.
// IsNotMountPoint will be called instead of IsLikelyNotMountPoint.
// IsNotMountPoint is more expensive but properly handles bind mounts.
// IsNotMountPoint is more expensive but properly handles bind mounts.
func
UnmountMountPoint
(
mountPath
string
,
mounter
Interface
,
extensiveMountPointCheck
bool
)
error
{
func
UnmountMountPoint
(
mountPath
string
,
mounter
Interface
,
extensiveMountPointCheck
bool
)
error
{
// mounter.ExistsPath cannot be used because for containerized kubelet, we need to check
// the path in the kubelet container, not on the host.
pathExists
,
pathErr
:=
PathExists
(
mountPath
)
pathExists
,
pathErr
:=
PathExists
(
mountPath
)
if
!
pathExists
{
if
!
pathExists
{
klog
.
Warningf
(
"Warning: Unmount skipped because path does not exist: %v"
,
mountPath
)
klog
.
Warningf
(
"Warning: Unmount skipped because path does not exist: %v"
,
mountPath
)
...
@@ -91,6 +93,7 @@ func doUnmountMountPoint(mountPath string, mounter Interface, extensiveMountPoin
...
@@ -91,6 +93,7 @@ func doUnmountMountPoint(mountPath string, mounter Interface, extensiveMountPoin
return
fmt
.
Errorf
(
"Failed to unmount path %v"
,
mountPath
)
return
fmt
.
Errorf
(
"Failed to unmount path %v"
,
mountPath
)
}
}
// TODO: clean this up to use pkg/util/file/FileExists
// PathExists returns true if the specified path exists.
// PathExists returns true if the specified path exists.
func
PathExists
(
path
string
)
(
bool
,
error
)
{
func
PathExists
(
path
string
)
(
bool
,
error
)
{
_
,
err
:=
os
.
Stat
(
path
)
_
,
err
:=
os
.
Stat
(
path
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment