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
93a19fce
Commit
93a19fce
authored
Aug 07, 2018
by
Chakri Nelluri
Committed by
Chakravarthy Nelluri
Aug 07, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ignore EIO error in unmount path
parent
f8b6c594
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
12 deletions
+23
-12
detacher.go
pkg/volume/flexvolume/detacher.go
+11
-4
unmounter.go
pkg/volume/flexvolume/unmounter.go
+6
-3
util.go
pkg/volume/util/util.go
+6
-5
No files found.
pkg/volume/flexvolume/detacher.go
View file @
93a19fce
...
@@ -49,17 +49,24 @@ func (d *flexVolumeDetacher) Detach(volumeName string, hostName types.NodeName)
...
@@ -49,17 +49,24 @@ func (d *flexVolumeDetacher) Detach(volumeName string, hostName types.NodeName)
// UnmountDevice is part of the volume.Detacher interface.
// UnmountDevice is part of the volume.Detacher interface.
func
(
d
*
flexVolumeDetacher
)
UnmountDevice
(
deviceMountPath
string
)
error
{
func
(
d
*
flexVolumeDetacher
)
UnmountDevice
(
deviceMountPath
string
)
error
{
if
pathExists
,
pathErr
:=
util
.
PathExists
(
deviceMountPath
);
pathErr
!=
nil
{
pathExists
,
pathErr
:=
util
.
PathExists
(
deviceMountPath
)
return
fmt
.
Errorf
(
"Error checking if path exists: %v"
,
pathErr
)
if
!
pathExists
{
}
else
if
!
pathExists
{
glog
.
Warningf
(
"Warning: Unmount skipped because path does not exist: %v"
,
deviceMountPath
)
glog
.
Warningf
(
"Warning: Unmount skipped because path does not exist: %v"
,
deviceMountPath
)
return
nil
return
nil
}
}
if
pathErr
!=
nil
&&
!
util
.
IsCorruptedMnt
(
pathErr
)
{
return
fmt
.
Errorf
(
"Error checking path: %v"
,
pathErr
)
}
notmnt
,
err
:=
isNotMounted
(
d
.
plugin
.
host
.
GetMounter
(
d
.
plugin
.
GetPluginName
()),
deviceMountPath
)
notmnt
,
err
:=
isNotMounted
(
d
.
plugin
.
host
.
GetMounter
(
d
.
plugin
.
GetPluginName
()),
deviceMountPath
)
if
err
!=
nil
{
if
err
!=
nil
{
return
err
if
util
.
IsCorruptedMnt
(
err
)
{
notmnt
=
false
// Corrupted error is assumed to be mounted.
}
else
{
return
err
}
}
}
if
notmnt
{
if
notmnt
{
glog
.
Warningf
(
"Warning: Path: %v already unmounted"
,
deviceMountPath
)
glog
.
Warningf
(
"Warning: Path: %v already unmounted"
,
deviceMountPath
)
}
else
{
}
else
{
...
...
pkg/volume/flexvolume/unmounter.go
View file @
93a19fce
...
@@ -44,13 +44,16 @@ func (f *flexVolumeUnmounter) TearDown() error {
...
@@ -44,13 +44,16 @@ func (f *flexVolumeUnmounter) TearDown() error {
func
(
f
*
flexVolumeUnmounter
)
TearDownAt
(
dir
string
)
error
{
func
(
f
*
flexVolumeUnmounter
)
TearDownAt
(
dir
string
)
error
{
if
pathExists
,
pathErr
:=
util
.
PathExists
(
dir
);
pathErr
!=
nil
{
pathExists
,
pathErr
:=
util
.
PathExists
(
dir
)
return
fmt
.
Errorf
(
"Error checking if path exists: %v"
,
pathErr
)
if
!
pathExists
{
}
else
if
!
pathExists
{
glog
.
Warningf
(
"Warning: Unmount skipped because path does not exist: %v"
,
dir
)
glog
.
Warningf
(
"Warning: Unmount skipped because path does not exist: %v"
,
dir
)
return
nil
return
nil
}
}
if
pathErr
!=
nil
&&
!
util
.
IsCorruptedMnt
(
pathErr
)
{
return
fmt
.
Errorf
(
"Error checking path: %v"
,
pathErr
)
}
call
:=
f
.
plugin
.
NewDriverCall
(
unmountCmd
)
call
:=
f
.
plugin
.
NewDriverCall
(
unmountCmd
)
call
.
Append
(
dir
)
call
.
Append
(
dir
)
_
,
err
:=
call
.
Run
()
_
,
err
:=
call
.
Run
()
...
...
pkg/volume/util/util.go
View file @
93a19fce
...
@@ -142,7 +142,7 @@ func UnmountMountPoint(mountPath string, mounter mount.Interface, extensiveMount
...
@@ -142,7 +142,7 @@ func UnmountMountPoint(mountPath string, mounter mount.Interface, extensiveMount
glog
.
Warningf
(
"Warning: Unmount skipped because path does not exist: %v"
,
mountPath
)
glog
.
Warningf
(
"Warning: Unmount skipped because path does not exist: %v"
,
mountPath
)
return
nil
return
nil
}
}
corruptedMnt
:=
i
sCorruptedMnt
(
pathErr
)
corruptedMnt
:=
I
sCorruptedMnt
(
pathErr
)
if
pathErr
!=
nil
&&
!
corruptedMnt
{
if
pathErr
!=
nil
&&
!
corruptedMnt
{
return
fmt
.
Errorf
(
"Error checking path: %v"
,
pathErr
)
return
fmt
.
Errorf
(
"Error checking path: %v"
,
pathErr
)
}
}
...
@@ -198,15 +198,15 @@ func PathExists(path string) (bool, error) {
...
@@ -198,15 +198,15 @@ func PathExists(path string) (bool, error) {
return
true
,
nil
return
true
,
nil
}
else
if
os
.
IsNotExist
(
err
)
{
}
else
if
os
.
IsNotExist
(
err
)
{
return
false
,
nil
return
false
,
nil
}
else
if
i
sCorruptedMnt
(
err
)
{
}
else
if
I
sCorruptedMnt
(
err
)
{
return
true
,
err
return
true
,
err
}
else
{
}
else
{
return
false
,
err
return
false
,
err
}
}
}
}
//
i
sCorruptedMnt return true if err is about corrupted mount point
//
I
sCorruptedMnt return true if err is about corrupted mount point
func
i
sCorruptedMnt
(
err
error
)
bool
{
func
I
sCorruptedMnt
(
err
error
)
bool
{
if
err
==
nil
{
if
err
==
nil
{
return
false
return
false
}
}
...
@@ -221,7 +221,8 @@ func isCorruptedMnt(err error) bool {
...
@@ -221,7 +221,8 @@ func isCorruptedMnt(err error) bool {
case
*
os
.
SyscallError
:
case
*
os
.
SyscallError
:
underlyingError
=
pe
.
Err
underlyingError
=
pe
.
Err
}
}
return
underlyingError
==
syscall
.
ENOTCONN
||
underlyingError
==
syscall
.
ESTALE
return
underlyingError
==
syscall
.
ENOTCONN
||
underlyingError
==
syscall
.
ESTALE
||
underlyingError
==
syscall
.
EIO
}
}
// GetSecretForPod locates secret by name in the pod's namespace and returns secret map
// GetSecretForPod locates secret by name in the pod's namespace and returns secret map
...
...
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