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
d94cd822
Commit
d94cd822
authored
Jan 07, 2019
by
danielqsj
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cleanup UnmountPath/UnmountMountPoint callers
parent
8728ecc2
Hide whitespace changes
Inline
Side-by-side
Showing
24 changed files
with
29 additions
and
46 deletions
+29
-46
attacher.go
pkg/volume/awsebs/attacher.go
+1
-1
aws_ebs.go
pkg/volume/awsebs/aws_ebs.go
+1
-1
attacher.go
pkg/volume/azure_dd/attacher.go
+1
-1
azure_file.go
pkg/volume/azure_file/azure_file.go
+1
-1
cephfs.go
pkg/volume/cephfs/cephfs.go
+2
-2
attacher.go
pkg/volume/cinder/attacher.go
+1
-1
attacher.go
pkg/volume/fc/attacher.go
+1
-1
fc.go
pkg/volume/fc/fc.go
+1
-1
detacher-defaults.go
pkg/volume/flexvolume/detacher-defaults.go
+2
-2
unmounter-defaults.go
pkg/volume/flexvolume/unmounter-defaults.go
+2
-2
flocker.go
pkg/volume/flocker/flocker.go
+1
-2
attacher.go
pkg/volume/gcepd/attacher.go
+2
-1
gce_pd.go
pkg/volume/gcepd/gce_pd.go
+1
-1
glusterfs.go
pkg/volume/glusterfs/glusterfs.go
+2
-2
iscsi.go
pkg/volume/iscsi/iscsi.go
+1
-1
local.go
pkg/volume/local/local.go
+2
-2
nfs.go
pkg/volume/nfs/nfs.go
+1
-1
attacher.go
pkg/volume/photon_pd/attacher.go
+1
-1
photon_pd.go
pkg/volume/photon_pd/photon_pd.go
+1
-1
sio_volume.go
pkg/volume/scaleio/sio_volume.go
+1
-1
storageos.go
pkg/volume/storageos/storageos.go
+1
-1
util.go
pkg/volume/util/util.go
+0
-17
attacher.go
pkg/volume/vsphere_volume/attacher.go
+1
-1
vsphere_volume.go
pkg/volume/vsphere_volume/vsphere_volume.go
+1
-1
No files found.
pkg/volume/awsebs/attacher.go
View file @
d94cd822
...
@@ -274,7 +274,7 @@ func (detacher *awsElasticBlockStoreDetacher) Detach(volumeName string, nodeName
...
@@ -274,7 +274,7 @@ func (detacher *awsElasticBlockStoreDetacher) Detach(volumeName string, nodeName
}
}
func
(
detacher
*
awsElasticBlockStoreDetacher
)
UnmountDevice
(
deviceMountPath
string
)
error
{
func
(
detacher
*
awsElasticBlockStoreDetacher
)
UnmountDevice
(
deviceMountPath
string
)
error
{
return
volumeutil
.
UnmountPath
(
deviceMountPath
,
detacher
.
mounter
)
return
mount
.
CleanupMountPoint
(
deviceMountPath
,
detacher
.
mounter
,
false
)
}
}
func
setNodeDisk
(
func
setNodeDisk
(
...
...
pkg/volume/awsebs/aws_ebs.go
View file @
d94cd822
...
@@ -485,7 +485,7 @@ func (c *awsElasticBlockStoreUnmounter) TearDown() error {
...
@@ -485,7 +485,7 @@ func (c *awsElasticBlockStoreUnmounter) TearDown() error {
// Unmounts the bind mount
// Unmounts the bind mount
func
(
c
*
awsElasticBlockStoreUnmounter
)
TearDownAt
(
dir
string
)
error
{
func
(
c
*
awsElasticBlockStoreUnmounter
)
TearDownAt
(
dir
string
)
error
{
return
util
.
UnmountPath
(
dir
,
c
.
mounter
)
return
mount
.
CleanupMountPoint
(
dir
,
c
.
mounter
,
false
)
}
}
type
awsElasticBlockStoreDeleter
struct
{
type
awsElasticBlockStoreDeleter
struct
{
...
...
pkg/volume/azure_dd/attacher.go
View file @
d94cd822
...
@@ -309,7 +309,7 @@ func (d *azureDiskDetacher) Detach(diskURI string, nodeName types.NodeName) erro
...
@@ -309,7 +309,7 @@ func (d *azureDiskDetacher) Detach(diskURI string, nodeName types.NodeName) erro
// UnmountDevice unmounts the volume on the node
// UnmountDevice unmounts the volume on the node
func
(
detacher
*
azureDiskDetacher
)
UnmountDevice
(
deviceMountPath
string
)
error
{
func
(
detacher
*
azureDiskDetacher
)
UnmountDevice
(
deviceMountPath
string
)
error
{
err
:=
util
.
UnmountPath
(
deviceMountPath
,
detacher
.
plugin
.
host
.
GetMounter
(
detacher
.
plugin
.
GetPluginName
())
)
err
:=
mount
.
CleanupMountPoint
(
deviceMountPath
,
detacher
.
plugin
.
host
.
GetMounter
(
detacher
.
plugin
.
GetPluginName
()),
false
)
if
err
==
nil
{
if
err
==
nil
{
klog
.
V
(
2
)
.
Infof
(
"azureDisk - Device %s was unmounted"
,
deviceMountPath
)
klog
.
V
(
2
)
.
Infof
(
"azureDisk - Device %s was unmounted"
,
deviceMountPath
)
}
else
{
}
else
{
...
...
pkg/volume/azure_file/azure_file.go
View file @
d94cd822
...
@@ -321,7 +321,7 @@ func (c *azureFileUnmounter) TearDown() error {
...
@@ -321,7 +321,7 @@ func (c *azureFileUnmounter) TearDown() error {
}
}
func
(
c
*
azureFileUnmounter
)
TearDownAt
(
dir
string
)
error
{
func
(
c
*
azureFileUnmounter
)
TearDownAt
(
dir
string
)
error
{
return
volutil
.
UnmountPath
(
dir
,
c
.
mounter
)
return
mount
.
CleanupMountPoint
(
dir
,
c
.
mounter
,
false
)
}
}
func
getVolumeSource
(
spec
*
volume
.
Spec
)
(
string
,
bool
,
error
)
{
func
getVolumeSource
(
spec
*
volume
.
Spec
)
(
string
,
bool
,
error
)
{
...
...
pkg/volume/cephfs/cephfs.go
View file @
d94cd822
...
@@ -260,7 +260,7 @@ func (cephfsVolume *cephfsMounter) SetUpAt(dir string, fsGroup *int64) error {
...
@@ -260,7 +260,7 @@ func (cephfsVolume *cephfsMounter) SetUpAt(dir string, fsGroup *int64) error {
err
=
cephfsVolume
.
execMount
(
dir
)
err
=
cephfsVolume
.
execMount
(
dir
)
if
err
!=
nil
{
if
err
!=
nil
{
// cleanup upon failure.
// cleanup upon failure.
util
.
UnmountPath
(
dir
,
cephfsVolume
.
mounter
)
mount
.
CleanupMountPoint
(
dir
,
cephfsVolume
.
mounter
,
false
)
return
err
return
err
}
}
return
nil
return
nil
...
@@ -279,7 +279,7 @@ func (cephfsVolume *cephfsUnmounter) TearDown() error {
...
@@ -279,7 +279,7 @@ func (cephfsVolume *cephfsUnmounter) TearDown() error {
// TearDownAt unmounts the bind mount
// TearDownAt unmounts the bind mount
func
(
cephfsVolume
*
cephfsUnmounter
)
TearDownAt
(
dir
string
)
error
{
func
(
cephfsVolume
*
cephfsUnmounter
)
TearDownAt
(
dir
string
)
error
{
return
util
.
UnmountPath
(
dir
,
cephfsVolume
.
mounter
)
return
mount
.
CleanupMountPoint
(
dir
,
cephfsVolume
.
mounter
,
false
)
}
}
// GetPath creates global mount path
// GetPath creates global mount path
...
...
pkg/volume/cinder/attacher.go
View file @
d94cd822
...
@@ -403,7 +403,7 @@ func (detacher *cinderDiskDetacher) Detach(volumeName string, nodeName types.Nod
...
@@ -403,7 +403,7 @@ func (detacher *cinderDiskDetacher) Detach(volumeName string, nodeName types.Nod
}
}
func
(
detacher
*
cinderDiskDetacher
)
UnmountDevice
(
deviceMountPath
string
)
error
{
func
(
detacher
*
cinderDiskDetacher
)
UnmountDevice
(
deviceMountPath
string
)
error
{
return
volumeutil
.
UnmountPath
(
deviceMountPath
,
detacher
.
mounter
)
return
mount
.
CleanupMountPoint
(
deviceMountPath
,
detacher
.
mounter
,
false
)
}
}
func
(
attacher
*
cinderDiskAttacher
)
nodeInstanceID
(
nodeName
types
.
NodeName
)
(
string
,
error
)
{
func
(
attacher
*
cinderDiskAttacher
)
nodeInstanceID
(
nodeName
types
.
NodeName
)
(
string
,
error
)
{
...
...
pkg/volume/fc/attacher.go
View file @
d94cd822
...
@@ -162,7 +162,7 @@ func (detacher *fcDetacher) UnmountDevice(deviceMountPath string) error {
...
@@ -162,7 +162,7 @@ func (detacher *fcDetacher) UnmountDevice(deviceMountPath string) error {
return
err
return
err
}
}
// Unmount for deviceMountPath(=globalPDPath)
// Unmount for deviceMountPath(=globalPDPath)
err
=
volumeutil
.
UnmountPath
(
deviceMountPath
,
detacher
.
mounter
)
err
=
mount
.
CleanupMountPoint
(
deviceMountPath
,
detacher
.
mounter
,
false
)
if
err
!=
nil
{
if
err
!=
nil
{
return
fmt
.
Errorf
(
"fc: failed to unmount: %s
\n
Error: %v"
,
deviceMountPath
,
err
)
return
fmt
.
Errorf
(
"fc: failed to unmount: %s
\n
Error: %v"
,
deviceMountPath
,
err
)
}
}
...
...
pkg/volume/fc/fc.go
View file @
d94cd822
...
@@ -427,7 +427,7 @@ func (c *fcDiskUnmounter) TearDown() error {
...
@@ -427,7 +427,7 @@ func (c *fcDiskUnmounter) TearDown() error {
}
}
func
(
c
*
fcDiskUnmounter
)
TearDownAt
(
dir
string
)
error
{
func
(
c
*
fcDiskUnmounter
)
TearDownAt
(
dir
string
)
error
{
return
util
.
UnmountPath
(
dir
,
c
.
mounter
)
return
mount
.
CleanupMountPoint
(
dir
,
c
.
mounter
,
false
)
}
}
// Block Volumes Support
// Block Volumes Support
...
...
pkg/volume/flexvolume/detacher-defaults.go
View file @
d94cd822
...
@@ -21,7 +21,7 @@ import (
...
@@ -21,7 +21,7 @@ import (
"k8s.io/apimachinery/pkg/types"
"k8s.io/apimachinery/pkg/types"
"k8s.io/klog"
"k8s.io/klog"
"k8s.io/kubernetes/pkg/
volume/util
"
"k8s.io/kubernetes/pkg/
util/mount
"
)
)
type
detacherDefaults
flexVolumeDetacher
type
detacherDefaults
flexVolumeDetacher
...
@@ -41,5 +41,5 @@ func (d *detacherDefaults) WaitForDetach(devicePath string, timeout time.Duratio
...
@@ -41,5 +41,5 @@ func (d *detacherDefaults) WaitForDetach(devicePath string, timeout time.Duratio
// UnmountDevice is part of the volume.Detacher interface.
// UnmountDevice is part of the volume.Detacher interface.
func
(
d
*
detacherDefaults
)
UnmountDevice
(
deviceMountPath
string
)
error
{
func
(
d
*
detacherDefaults
)
UnmountDevice
(
deviceMountPath
string
)
error
{
klog
.
Warning
(
logPrefix
(
d
.
plugin
.
flexVolumePlugin
),
"using default UnmountDevice for device mount path "
,
deviceMountPath
)
klog
.
Warning
(
logPrefix
(
d
.
plugin
.
flexVolumePlugin
),
"using default UnmountDevice for device mount path "
,
deviceMountPath
)
return
util
.
UnmountPath
(
deviceMountPath
,
d
.
plugin
.
host
.
GetMounter
(
d
.
plugin
.
GetPluginName
())
)
return
mount
.
CleanupMountPoint
(
deviceMountPath
,
d
.
plugin
.
host
.
GetMounter
(
d
.
plugin
.
GetPluginName
()),
false
)
}
}
pkg/volume/flexvolume/unmounter-defaults.go
View file @
d94cd822
...
@@ -18,12 +18,12 @@ package flexvolume
...
@@ -18,12 +18,12 @@ package flexvolume
import
(
import
(
"k8s.io/klog"
"k8s.io/klog"
"k8s.io/kubernetes/pkg/
volume/util
"
"k8s.io/kubernetes/pkg/
util/mount
"
)
)
type
unmounterDefaults
flexVolumeUnmounter
type
unmounterDefaults
flexVolumeUnmounter
func
(
f
*
unmounterDefaults
)
TearDownAt
(
dir
string
)
error
{
func
(
f
*
unmounterDefaults
)
TearDownAt
(
dir
string
)
error
{
klog
.
Warning
(
logPrefix
(
f
.
plugin
),
"using default TearDownAt for "
,
dir
)
klog
.
Warning
(
logPrefix
(
f
.
plugin
),
"using default TearDownAt for "
,
dir
)
return
util
.
UnmountPath
(
dir
,
f
.
mounter
)
return
mount
.
CleanupMountPoint
(
dir
,
f
.
mounter
,
false
)
}
}
pkg/volume/flocker/flocker.go
View file @
d94cd822
...
@@ -31,7 +31,6 @@ import (
...
@@ -31,7 +31,6 @@ import (
"k8s.io/kubernetes/pkg/volume"
"k8s.io/kubernetes/pkg/volume"
flockerapi
"github.com/clusterhq/flocker-go"
flockerapi
"github.com/clusterhq/flocker-go"
"k8s.io/kubernetes/pkg/volume/util"
)
)
// ProbeVolumePlugins is the primary entrypoint for volume plugins.
// ProbeVolumePlugins is the primary entrypoint for volume plugins.
...
@@ -430,7 +429,7 @@ func (c *flockerVolumeUnmounter) TearDown() error {
...
@@ -430,7 +429,7 @@ func (c *flockerVolumeUnmounter) TearDown() error {
// TearDownAt unmounts the bind mount
// TearDownAt unmounts the bind mount
func
(
c
*
flockerVolumeUnmounter
)
TearDownAt
(
dir
string
)
error
{
func
(
c
*
flockerVolumeUnmounter
)
TearDownAt
(
dir
string
)
error
{
return
util
.
UnmountPath
(
dir
,
c
.
mounter
)
return
mount
.
CleanupMountPoint
(
dir
,
c
.
mounter
,
false
)
}
}
func
(
p
*
flockerPlugin
)
NewDeleter
(
spec
*
volume
.
Spec
)
(
volume
.
Deleter
,
error
)
{
func
(
p
*
flockerPlugin
)
NewDeleter
(
spec
*
volume
.
Spec
)
(
volume
.
Deleter
,
error
)
{
...
...
pkg/volume/gcepd/attacher.go
View file @
d94cd822
...
@@ -29,6 +29,7 @@ import (
...
@@ -29,6 +29,7 @@ import (
"k8s.io/apimachinery/pkg/util/sets"
"k8s.io/apimachinery/pkg/util/sets"
"k8s.io/klog"
"k8s.io/klog"
"k8s.io/kubernetes/pkg/cloudprovider/providers/gce"
"k8s.io/kubernetes/pkg/cloudprovider/providers/gce"
"k8s.io/kubernetes/pkg/util/mount"
"k8s.io/kubernetes/pkg/volume"
"k8s.io/kubernetes/pkg/volume"
volumeutil
"k8s.io/kubernetes/pkg/volume/util"
volumeutil
"k8s.io/kubernetes/pkg/volume/util"
)
)
...
@@ -285,5 +286,5 @@ func (detacher *gcePersistentDiskDetacher) Detach(volumeName string, nodeName ty
...
@@ -285,5 +286,5 @@ func (detacher *gcePersistentDiskDetacher) Detach(volumeName string, nodeName ty
}
}
func
(
detacher
*
gcePersistentDiskDetacher
)
UnmountDevice
(
deviceMountPath
string
)
error
{
func
(
detacher
*
gcePersistentDiskDetacher
)
UnmountDevice
(
deviceMountPath
string
)
error
{
return
volumeutil
.
UnmountPath
(
deviceMountPath
,
detacher
.
host
.
GetMounter
(
gcePersistentDiskPluginName
)
)
return
mount
.
CleanupMountPoint
(
deviceMountPath
,
detacher
.
host
.
GetMounter
(
gcePersistentDiskPluginName
),
false
)
}
}
pkg/volume/gcepd/gce_pd.go
View file @
d94cd822
...
@@ -454,7 +454,7 @@ func (c *gcePersistentDiskUnmounter) TearDown() error {
...
@@ -454,7 +454,7 @@ func (c *gcePersistentDiskUnmounter) TearDown() error {
// TearDownAt unmounts the bind mount
// TearDownAt unmounts the bind mount
func
(
c
*
gcePersistentDiskUnmounter
)
TearDownAt
(
dir
string
)
error
{
func
(
c
*
gcePersistentDiskUnmounter
)
TearDownAt
(
dir
string
)
error
{
return
util
.
UnmountPath
(
dir
,
c
.
mounter
)
return
mount
.
CleanupMountPoint
(
dir
,
c
.
mounter
,
false
)
}
}
type
gcePersistentDiskDeleter
struct
{
type
gcePersistentDiskDeleter
struct
{
...
...
pkg/volume/glusterfs/glusterfs.go
View file @
d94cd822
...
@@ -291,7 +291,7 @@ func (b *glusterfsMounter) SetUpAt(dir string, fsGroup *int64) error {
...
@@ -291,7 +291,7 @@ func (b *glusterfsMounter) SetUpAt(dir string, fsGroup *int64) error {
}
}
// Cleanup upon failure.
// Cleanup upon failure.
volutil
.
UnmountPath
(
dir
,
b
.
mounter
)
mount
.
CleanupMountPoint
(
dir
,
b
.
mounter
,
false
)
return
err
return
err
}
}
...
@@ -311,7 +311,7 @@ func (c *glusterfsUnmounter) TearDown() error {
...
@@ -311,7 +311,7 @@ func (c *glusterfsUnmounter) TearDown() error {
}
}
func
(
c
*
glusterfsUnmounter
)
TearDownAt
(
dir
string
)
error
{
func
(
c
*
glusterfsUnmounter
)
TearDownAt
(
dir
string
)
error
{
return
volutil
.
UnmountPath
(
dir
,
c
.
mounter
)
return
mount
.
CleanupMountPoint
(
dir
,
c
.
mounter
,
false
)
}
}
func
(
b
*
glusterfsMounter
)
setUpAtInternal
(
dir
string
)
error
{
func
(
b
*
glusterfsMounter
)
setUpAtInternal
(
dir
string
)
error
{
...
...
pkg/volume/iscsi/iscsi.go
View file @
d94cd822
...
@@ -355,7 +355,7 @@ func (c *iscsiDiskUnmounter) TearDown() error {
...
@@ -355,7 +355,7 @@ func (c *iscsiDiskUnmounter) TearDown() error {
}
}
func
(
c
*
iscsiDiskUnmounter
)
TearDownAt
(
dir
string
)
error
{
func
(
c
*
iscsiDiskUnmounter
)
TearDownAt
(
dir
string
)
error
{
return
ioutil
.
UnmountPath
(
dir
,
c
.
mounter
)
return
mount
.
CleanupMountPoint
(
dir
,
c
.
mounter
,
false
)
}
}
// Block Volumes Support
// Block Volumes Support
...
...
pkg/volume/local/local.go
View file @
d94cd822
...
@@ -367,7 +367,7 @@ func (dm *deviceMounter) UnmountDevice(deviceMountPath string) error {
...
@@ -367,7 +367,7 @@ func (dm *deviceMounter) UnmountDevice(deviceMountPath string) error {
// has base mount path: /var/lib/kubelet/plugins/kubernetes.io/local-volume/mounts
// has base mount path: /var/lib/kubelet/plugins/kubernetes.io/local-volume/mounts
basemountPath
:=
dm
.
plugin
.
generateBlockDeviceBaseGlobalPath
()
basemountPath
:=
dm
.
plugin
.
generateBlockDeviceBaseGlobalPath
()
if
mount
.
PathWithinBase
(
deviceMountPath
,
basemountPath
)
{
if
mount
.
PathWithinBase
(
deviceMountPath
,
basemountPath
)
{
return
util
.
UnmountPath
(
deviceMountPath
,
dm
.
mounter
)
return
mount
.
CleanupMountPoint
(
deviceMountPath
,
dm
.
mounter
,
false
)
}
}
return
nil
return
nil
...
@@ -542,7 +542,7 @@ func (u *localVolumeUnmounter) TearDown() error {
...
@@ -542,7 +542,7 @@ func (u *localVolumeUnmounter) TearDown() error {
// TearDownAt unmounts the bind mount
// TearDownAt unmounts the bind mount
func
(
u
*
localVolumeUnmounter
)
TearDownAt
(
dir
string
)
error
{
func
(
u
*
localVolumeUnmounter
)
TearDownAt
(
dir
string
)
error
{
klog
.
V
(
4
)
.
Infof
(
"Unmounting volume %q at path %q
\n
"
,
u
.
volName
,
dir
)
klog
.
V
(
4
)
.
Infof
(
"Unmounting volume %q at path %q
\n
"
,
u
.
volName
,
dir
)
return
util
.
Unmount
MountPoint
(
dir
,
u
.
mounter
,
true
)
/* extensiveMountPointCheck = true */
return
mount
.
Cleanup
MountPoint
(
dir
,
u
.
mounter
,
true
)
/* extensiveMountPointCheck = true */
}
}
// localVolumeMapper implements the BlockVolumeMapper interface for local volumes.
// localVolumeMapper implements the BlockVolumeMapper interface for local volumes.
...
...
pkg/volume/nfs/nfs.go
View file @
d94cd822
...
@@ -294,7 +294,7 @@ func (c *nfsUnmounter) TearDownAt(dir string) error {
...
@@ -294,7 +294,7 @@ func (c *nfsUnmounter) TearDownAt(dir string) error {
// Use extensiveMountPointCheck to consult /proc/mounts. We can't use faster
// Use extensiveMountPointCheck to consult /proc/mounts. We can't use faster
// IsLikelyNotMountPoint (lstat()), since there may be root_squash on the
// IsLikelyNotMountPoint (lstat()), since there may be root_squash on the
// NFS server and kubelet may not be able to do lstat/stat() there.
// NFS server and kubelet may not be able to do lstat/stat() there.
return
util
.
Unmount
MountPoint
(
dir
,
c
.
mounter
,
true
/* extensiveMountPointCheck */
)
return
mount
.
Cleanup
MountPoint
(
dir
,
c
.
mounter
,
true
/* extensiveMountPointCheck */
)
}
}
func
getVolumeSource
(
spec
*
volume
.
Spec
)
(
*
v1
.
NFSVolumeSource
,
bool
,
error
)
{
func
getVolumeSource
(
spec
*
volume
.
Spec
)
(
*
v1
.
NFSVolumeSource
,
bool
,
error
)
{
...
...
pkg/volume/photon_pd/attacher.go
View file @
d94cd822
...
@@ -305,5 +305,5 @@ func (detacher *photonPersistentDiskDetacher) WaitForDetach(devicePath string, t
...
@@ -305,5 +305,5 @@ func (detacher *photonPersistentDiskDetacher) WaitForDetach(devicePath string, t
}
}
func
(
detacher
*
photonPersistentDiskDetacher
)
UnmountDevice
(
deviceMountPath
string
)
error
{
func
(
detacher
*
photonPersistentDiskDetacher
)
UnmountDevice
(
deviceMountPath
string
)
error
{
return
volumeutil
.
UnmountPath
(
deviceMountPath
,
detacher
.
mounter
)
return
mount
.
CleanupMountPoint
(
deviceMountPath
,
detacher
.
mounter
,
false
)
}
}
pkg/volume/photon_pd/photon_pd.go
View file @
d94cd822
...
@@ -277,7 +277,7 @@ func (c *photonPersistentDiskUnmounter) TearDown() error {
...
@@ -277,7 +277,7 @@ func (c *photonPersistentDiskUnmounter) TearDown() error {
// Unmounts the bind mount, and detaches the disk only if the PD
// Unmounts the bind mount, and detaches the disk only if the PD
// resource was the last reference to that disk on the kubelet.
// resource was the last reference to that disk on the kubelet.
func
(
c
*
photonPersistentDiskUnmounter
)
TearDownAt
(
dir
string
)
error
{
func
(
c
*
photonPersistentDiskUnmounter
)
TearDownAt
(
dir
string
)
error
{
return
util
.
UnmountPath
(
dir
,
c
.
mounter
)
return
mount
.
CleanupMountPoint
(
dir
,
c
.
mounter
,
false
)
}
}
func
makeGlobalPDPath
(
host
volume
.
VolumeHost
,
devName
string
)
string
{
func
makeGlobalPDPath
(
host
volume
.
VolumeHost
,
devName
string
)
string
{
...
...
pkg/volume/scaleio/sio_volume.go
View file @
d94cd822
...
@@ -193,7 +193,7 @@ func (v *sioVolume) TearDownAt(dir string) error {
...
@@ -193,7 +193,7 @@ func (v *sioVolume) TearDownAt(dir string) error {
}
}
klog
.
V
(
4
)
.
Info
(
log
(
"attempting to unmount %s"
,
dir
))
klog
.
V
(
4
)
.
Info
(
log
(
"attempting to unmount %s"
,
dir
))
if
err
:=
util
.
UnmountPath
(
dir
,
mounter
);
err
!=
nil
{
if
err
:=
mount
.
CleanupMountPoint
(
dir
,
mounter
,
false
);
err
!=
nil
{
klog
.
Error
(
log
(
"teardown failed while unmounting dir %s: %v "
,
dir
,
err
))
klog
.
Error
(
log
(
"teardown failed while unmounting dir %s: %v "
,
dir
,
err
))
return
err
return
err
}
}
...
...
pkg/volume/storageos/storageos.go
View file @
d94cd822
...
@@ -529,7 +529,7 @@ func (b *storageosUnmounter) TearDown() error {
...
@@ -529,7 +529,7 @@ func (b *storageosUnmounter) TearDown() error {
// Unmounts the bind mount, and detaches the disk only if the PD
// Unmounts the bind mount, and detaches the disk only if the PD
// resource was the last reference to that disk on the kubelet.
// resource was the last reference to that disk on the kubelet.
func
(
b
*
storageosUnmounter
)
TearDownAt
(
dir
string
)
error
{
func
(
b
*
storageosUnmounter
)
TearDownAt
(
dir
string
)
error
{
if
err
:=
util
.
UnmountPath
(
dir
,
b
.
mounter
);
err
!=
nil
{
if
err
:=
mount
.
CleanupMountPoint
(
dir
,
b
.
mounter
,
false
);
err
!=
nil
{
klog
.
V
(
4
)
.
Infof
(
"Unmounted StorageOS volume %s failed with: %v"
,
b
.
pvName
,
err
)
klog
.
V
(
4
)
.
Infof
(
"Unmounted StorageOS volume %s failed with: %v"
,
b
.
pvName
,
err
)
}
}
if
err
:=
b
.
manager
.
UnmountVolume
(
b
);
err
!=
nil
{
if
err
:=
b
.
manager
.
UnmountVolume
(
b
);
err
!=
nil
{
...
...
pkg/volume/util/util.go
View file @
d94cd822
...
@@ -125,23 +125,6 @@ func SetReady(dir string) {
...
@@ -125,23 +125,6 @@ func SetReady(dir string) {
file
.
Close
()
file
.
Close
()
}
}
// UnmountPath is a common unmount routine that unmounts the given path and
// deletes the remaining directory if successful.
// TODO: Remove this function and change callers to call mount pkg directly
func
UnmountPath
(
mountPath
string
,
mounter
mount
.
Interface
)
error
{
return
mount
.
CleanupMountPoint
(
mountPath
,
mounter
,
false
/* extensiveMountPointCheck */
)
}
// UnmountMountPoint is a common unmount routine that unmounts the given path and
// deletes the remaining directory if successful.
// if extensiveMountPointCheck is true
// IsNotMountPoint will be called instead of IsLikelyNotMountPoint.
// IsNotMountPoint is more expensive but properly handles bind mounts.
// TODO: Change callers to call mount pkg directly
func
UnmountMountPoint
(
mountPath
string
,
mounter
mount
.
Interface
,
extensiveMountPointCheck
bool
)
error
{
return
mount
.
CleanupMountPoint
(
mountPath
,
mounter
,
extensiveMountPointCheck
)
}
// PathExists returns true if the specified path exists.
// PathExists returns true if the specified path exists.
// TODO: Change callers to call mount pkg directly
// TODO: Change callers to call mount pkg directly
func
PathExists
(
path
string
)
(
bool
,
error
)
{
func
PathExists
(
path
string
)
(
bool
,
error
)
{
...
...
pkg/volume/vsphere_volume/attacher.go
View file @
d94cd822
...
@@ -292,7 +292,7 @@ func (detacher *vsphereVMDKDetacher) Detach(volumeName string, nodeName types.No
...
@@ -292,7 +292,7 @@ func (detacher *vsphereVMDKDetacher) Detach(volumeName string, nodeName types.No
}
}
func
(
detacher
*
vsphereVMDKDetacher
)
UnmountDevice
(
deviceMountPath
string
)
error
{
func
(
detacher
*
vsphereVMDKDetacher
)
UnmountDevice
(
deviceMountPath
string
)
error
{
return
volumeutil
.
UnmountPath
(
deviceMountPath
,
detacher
.
mounter
)
return
mount
.
CleanupMountPoint
(
deviceMountPath
,
detacher
.
mounter
,
false
)
}
}
func
setNodeVolume
(
func
setNodeVolume
(
...
...
pkg/volume/vsphere_volume/vsphere_volume.go
View file @
d94cd822
...
@@ -285,7 +285,7 @@ func (v *vsphereVolumeUnmounter) TearDown() error {
...
@@ -285,7 +285,7 @@ func (v *vsphereVolumeUnmounter) TearDown() error {
// Unmounts the bind mount, and detaches the disk only if the PD
// Unmounts the bind mount, and detaches the disk only if the PD
// resource was the last reference to that disk on the kubelet.
// resource was the last reference to that disk on the kubelet.
func
(
v
*
vsphereVolumeUnmounter
)
TearDownAt
(
dir
string
)
error
{
func
(
v
*
vsphereVolumeUnmounter
)
TearDownAt
(
dir
string
)
error
{
return
util
.
UnmountPath
(
dir
,
v
.
mounter
)
return
mount
.
CleanupMountPoint
(
dir
,
v
.
mounter
,
false
)
}
}
func
makeGlobalPDPath
(
host
volume
.
VolumeHost
,
devName
string
)
string
{
func
makeGlobalPDPath
(
host
volume
.
VolumeHost
,
devName
string
)
string
{
...
...
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