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
037ab985
Commit
037ab985
authored
Dec 28, 2018
by
Yecheng Fu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Deprecate mount.IsNotMountPoint
parent
76e9089d
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
12 additions
and
15 deletions
+12
-15
exec_mount_unsupported.go
pkg/util/mount/exec_mount_unsupported.go
+1
-1
fake.go
pkg/util/mount/fake.go
+1
-1
mount.go
pkg/util/mount/mount.go
+3
-6
mount_helper.go
pkg/util/mount/mount_helper.go
+1
-1
mount_linux.go
pkg/util/mount/mount_linux.go
+2
-2
mount_unsupported.go
pkg/util/mount/mount_unsupported.go
+1
-1
mount_windows.go
pkg/util/mount/mount_windows.go
+1
-1
nsenter_mount.go
pkg/util/mount/nsenter_mount.go
+1
-1
nsenter_mount_unsupported.go
pkg/util/mount/nsenter_mount_unsupported.go
+1
-1
No files found.
pkg/util/mount/exec_mount_unsupported.go
View file @
037ab985
...
@@ -48,7 +48,7 @@ func (mounter *execMounter) IsMountPointMatch(mp MountPoint, dir string) bool {
...
@@ -48,7 +48,7 @@ func (mounter *execMounter) IsMountPointMatch(mp MountPoint, dir string) bool {
}
}
func
(
mounter
*
execMounter
)
IsNotMountPoint
(
dir
string
)
(
bool
,
error
)
{
func
(
mounter
*
execMounter
)
IsNotMountPoint
(
dir
string
)
(
bool
,
error
)
{
return
I
sNotMountPoint
(
mounter
,
dir
)
return
i
sNotMountPoint
(
mounter
,
dir
)
}
}
func
(
mounter
*
execMounter
)
IsLikelyNotMountPoint
(
file
string
)
(
bool
,
error
)
{
func
(
mounter
*
execMounter
)
IsLikelyNotMountPoint
(
file
string
)
(
bool
,
error
)
{
...
...
pkg/util/mount/fake.go
View file @
037ab985
...
@@ -137,7 +137,7 @@ func (f *FakeMounter) IsMountPointMatch(mp MountPoint, dir string) bool {
...
@@ -137,7 +137,7 @@ func (f *FakeMounter) IsMountPointMatch(mp MountPoint, dir string) bool {
}
}
func
(
f
*
FakeMounter
)
IsNotMountPoint
(
dir
string
)
(
bool
,
error
)
{
func
(
f
*
FakeMounter
)
IsNotMountPoint
(
dir
string
)
(
bool
,
error
)
{
return
I
sNotMountPoint
(
f
,
dir
)
return
i
sNotMountPoint
(
f
,
dir
)
}
}
func
(
f
*
FakeMounter
)
IsLikelyNotMountPoint
(
file
string
)
(
bool
,
error
)
{
func
(
f
*
FakeMounter
)
IsLikelyNotMountPoint
(
file
string
)
(
bool
,
error
)
{
...
...
pkg/util/mount/mount.go
View file @
037ab985
...
@@ -245,12 +245,9 @@ func GetDeviceNameFromMount(mounter Interface, mountPath string) (string, int, e
...
@@ -245,12 +245,9 @@ func GetDeviceNameFromMount(mounter Interface, mountPath string) (string, int, e
return
device
,
refCount
,
nil
return
device
,
refCount
,
nil
}
}
// IsNotMountPoint determines if a directory is a mountpoint.
// isNotMountPoint implements Mounter.IsNotMountPoint and is shared by mounter
// It should return ErrNotExist when the directory does not exist.
// implementations.
// This method uses the List() of all mountpoints
func
isNotMountPoint
(
mounter
Interface
,
file
string
)
(
bool
,
error
)
{
// It is more extensive than IsLikelyNotMountPoint
// and it detects bind mounts in linux
func
IsNotMountPoint
(
mounter
Interface
,
file
string
)
(
bool
,
error
)
{
// IsLikelyNotMountPoint provides a quick check
// IsLikelyNotMountPoint provides a quick check
// to determine whether file IS A mountpoint
// to determine whether file IS A mountpoint
notMnt
,
notMntErr
:=
mounter
.
IsLikelyNotMountPoint
(
file
)
notMnt
,
notMntErr
:=
mounter
.
IsLikelyNotMountPoint
(
file
)
...
...
pkg/util/mount/mount_helper.go
View file @
037ab985
...
@@ -56,7 +56,7 @@ func doCleanupMountPoint(mountPath string, mounter Interface, extensiveMountPoin
...
@@ -56,7 +56,7 @@ func doCleanupMountPoint(mountPath string, mounter Interface, extensiveMountPoin
var
notMnt
bool
var
notMnt
bool
var
err
error
var
err
error
if
extensiveMountPointCheck
{
if
extensiveMountPointCheck
{
notMnt
,
err
=
IsNotMountPoint
(
mounter
,
mountPath
)
notMnt
,
err
=
mounter
.
IsNotMountPoint
(
mountPath
)
}
else
{
}
else
{
notMnt
,
err
=
mounter
.
IsLikelyNotMountPoint
(
mountPath
)
notMnt
,
err
=
mounter
.
IsLikelyNotMountPoint
(
mountPath
)
}
}
...
...
pkg/util/mount/mount_linux.go
View file @
037ab985
...
@@ -229,7 +229,7 @@ func (mounter *Mounter) IsMountPointMatch(mp MountPoint, dir string) bool {
...
@@ -229,7 +229,7 @@ func (mounter *Mounter) IsMountPointMatch(mp MountPoint, dir string) bool {
}
}
func
(
mounter
*
Mounter
)
IsNotMountPoint
(
dir
string
)
(
bool
,
error
)
{
func
(
mounter
*
Mounter
)
IsNotMountPoint
(
dir
string
)
(
bool
,
error
)
{
return
I
sNotMountPoint
(
mounter
,
dir
)
return
i
sNotMountPoint
(
mounter
,
dir
)
}
}
// IsLikelyNotMountPoint determines if a directory is not a mountpoint.
// IsLikelyNotMountPoint determines if a directory is not a mountpoint.
...
@@ -757,7 +757,7 @@ func safeOpenSubPath(mounter Interface, subpath Subpath) (int, error) {
...
@@ -757,7 +757,7 @@ func safeOpenSubPath(mounter Interface, subpath Subpath) (int, error) {
func
prepareSubpathTarget
(
mounter
Interface
,
subpath
Subpath
)
(
bool
,
string
,
error
)
{
func
prepareSubpathTarget
(
mounter
Interface
,
subpath
Subpath
)
(
bool
,
string
,
error
)
{
// Early check for already bind-mounted subpath.
// Early check for already bind-mounted subpath.
bindPathTarget
:=
getSubpathBindTarget
(
subpath
)
bindPathTarget
:=
getSubpathBindTarget
(
subpath
)
notMount
,
err
:=
IsNotMountPoint
(
mounter
,
bindPathTarget
)
notMount
,
err
:=
mounter
.
IsNotMountPoint
(
bindPathTarget
)
if
err
!=
nil
{
if
err
!=
nil
{
if
!
os
.
IsNotExist
(
err
)
{
if
!
os
.
IsNotExist
(
err
)
{
return
false
,
""
,
fmt
.
Errorf
(
"error checking path %s for mount: %s"
,
bindPathTarget
,
err
)
return
false
,
""
,
fmt
.
Errorf
(
"error checking path %s for mount: %s"
,
bindPathTarget
,
err
)
...
...
pkg/util/mount/mount_unsupported.go
View file @
037ab985
...
@@ -55,7 +55,7 @@ func (mounter *Mounter) IsMountPointMatch(mp MountPoint, dir string) bool {
...
@@ -55,7 +55,7 @@ func (mounter *Mounter) IsMountPointMatch(mp MountPoint, dir string) bool {
}
}
func
(
mounter
*
Mounter
)
IsNotMountPoint
(
dir
string
)
(
bool
,
error
)
{
func
(
mounter
*
Mounter
)
IsNotMountPoint
(
dir
string
)
(
bool
,
error
)
{
return
I
sNotMountPoint
(
mounter
,
dir
)
return
i
sNotMountPoint
(
mounter
,
dir
)
}
}
func
(
mounter
*
Mounter
)
IsLikelyNotMountPoint
(
file
string
)
(
bool
,
error
)
{
func
(
mounter
*
Mounter
)
IsLikelyNotMountPoint
(
file
string
)
(
bool
,
error
)
{
...
...
pkg/util/mount/mount_windows.go
View file @
037ab985
...
@@ -132,7 +132,7 @@ func (mounter *Mounter) IsMountPointMatch(mp MountPoint, dir string) bool {
...
@@ -132,7 +132,7 @@ func (mounter *Mounter) IsMountPointMatch(mp MountPoint, dir string) bool {
// IsNotMountPoint determines if a directory is a mountpoint.
// IsNotMountPoint determines if a directory is a mountpoint.
func
(
mounter
*
Mounter
)
IsNotMountPoint
(
dir
string
)
(
bool
,
error
)
{
func
(
mounter
*
Mounter
)
IsNotMountPoint
(
dir
string
)
(
bool
,
error
)
{
return
I
sNotMountPoint
(
mounter
,
dir
)
return
i
sNotMountPoint
(
mounter
,
dir
)
}
}
// IsLikelyNotMountPoint determines if a directory is not a mountpoint.
// IsLikelyNotMountPoint determines if a directory is not a mountpoint.
...
...
pkg/util/mount/nsenter_mount.go
View file @
037ab985
...
@@ -145,7 +145,7 @@ func (*NsenterMounter) List() ([]MountPoint, error) {
...
@@ -145,7 +145,7 @@ func (*NsenterMounter) List() ([]MountPoint, error) {
}
}
func
(
m
*
NsenterMounter
)
IsNotMountPoint
(
dir
string
)
(
bool
,
error
)
{
func
(
m
*
NsenterMounter
)
IsNotMountPoint
(
dir
string
)
(
bool
,
error
)
{
return
I
sNotMountPoint
(
m
,
dir
)
return
i
sNotMountPoint
(
m
,
dir
)
}
}
func
(
*
NsenterMounter
)
IsMountPointMatch
(
mp
MountPoint
,
dir
string
)
bool
{
func
(
*
NsenterMounter
)
IsMountPointMatch
(
mp
MountPoint
,
dir
string
)
bool
{
...
...
pkg/util/mount/nsenter_mount_unsupported.go
View file @
037ab985
...
@@ -46,7 +46,7 @@ func (*NsenterMounter) List() ([]MountPoint, error) {
...
@@ -46,7 +46,7 @@ func (*NsenterMounter) List() ([]MountPoint, error) {
}
}
func
(
m
*
NsenterMounter
)
IsNotMountPoint
(
dir
string
)
(
bool
,
error
)
{
func
(
m
*
NsenterMounter
)
IsNotMountPoint
(
dir
string
)
(
bool
,
error
)
{
return
I
sNotMountPoint
(
m
,
dir
)
return
i
sNotMountPoint
(
m
,
dir
)
}
}
func
(
*
NsenterMounter
)
IsMountPointMatch
(
mp
MountPoint
,
dir
string
)
bool
{
func
(
*
NsenterMounter
)
IsMountPointMatch
(
mp
MountPoint
,
dir
string
)
bool
{
...
...
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