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
2426f0ee
Commit
2426f0ee
authored
Jan 08, 2019
by
danielqsj
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cleanup IsCorruptedMnt callers
parent
8092904e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
3 additions
and
11 deletions
+3
-11
detacher.go
pkg/volume/flexvolume/detacher.go
+2
-3
unmounter.go
pkg/volume/flexvolume/unmounter.go
+1
-2
util.go
pkg/volume/util/util.go
+0
-6
No files found.
pkg/volume/flexvolume/detacher.go
View file @
2426f0ee
...
@@ -24,7 +24,6 @@ import (
...
@@ -24,7 +24,6 @@ import (
"k8s.io/klog"
"k8s.io/klog"
"k8s.io/kubernetes/pkg/util/mount"
"k8s.io/kubernetes/pkg/util/mount"
"k8s.io/kubernetes/pkg/volume"
"k8s.io/kubernetes/pkg/volume"
"k8s.io/kubernetes/pkg/volume/util"
)
)
type
flexVolumeDetacher
struct
{
type
flexVolumeDetacher
struct
{
...
@@ -57,13 +56,13 @@ func (d *flexVolumeDetacher) UnmountDevice(deviceMountPath string) error {
...
@@ -57,13 +56,13 @@ func (d *flexVolumeDetacher) UnmountDevice(deviceMountPath string) error {
klog
.
Warningf
(
"Warning: Unmount skipped because path does not exist: %v"
,
deviceMountPath
)
klog
.
Warningf
(
"Warning: Unmount skipped because path does not exist: %v"
,
deviceMountPath
)
return
nil
return
nil
}
}
if
pathErr
!=
nil
&&
!
util
.
IsCorruptedMnt
(
pathErr
)
{
if
pathErr
!=
nil
&&
!
mount
.
IsCorruptedMnt
(
pathErr
)
{
return
fmt
.
Errorf
(
"Error checking path: %v"
,
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
{
if
util
.
IsCorruptedMnt
(
err
)
{
if
mount
.
IsCorruptedMnt
(
err
)
{
notmnt
=
false
// Corrupted error is assumed to be mounted.
notmnt
=
false
// Corrupted error is assumed to be mounted.
}
else
{
}
else
{
return
err
return
err
...
...
pkg/volume/flexvolume/unmounter.go
View file @
2426f0ee
...
@@ -23,7 +23,6 @@ import (
...
@@ -23,7 +23,6 @@ import (
"k8s.io/klog"
"k8s.io/klog"
"k8s.io/kubernetes/pkg/util/mount"
"k8s.io/kubernetes/pkg/util/mount"
"k8s.io/kubernetes/pkg/volume"
"k8s.io/kubernetes/pkg/volume"
"k8s.io/kubernetes/pkg/volume/util"
"k8s.io/utils/exec"
"k8s.io/utils/exec"
)
)
...
@@ -50,7 +49,7 @@ func (f *flexVolumeUnmounter) TearDownAt(dir string) error {
...
@@ -50,7 +49,7 @@ func (f *flexVolumeUnmounter) TearDownAt(dir string) error {
return
nil
return
nil
}
}
if
pathErr
!=
nil
&&
!
util
.
IsCorruptedMnt
(
pathErr
)
{
if
pathErr
!=
nil
&&
!
mount
.
IsCorruptedMnt
(
pathErr
)
{
return
fmt
.
Errorf
(
"Error checking path: %v"
,
pathErr
)
return
fmt
.
Errorf
(
"Error checking path: %v"
,
pathErr
)
}
}
...
...
pkg/volume/util/util.go
View file @
2426f0ee
...
@@ -125,12 +125,6 @@ func SetReady(dir string) {
...
@@ -125,12 +125,6 @@ func SetReady(dir string) {
file
.
Close
()
file
.
Close
()
}
}
// IsCorruptedMnt return true if err is about corrupted mount point
// TODO: Change callers to call mount pkg directly
func
IsCorruptedMnt
(
err
error
)
bool
{
return
mount
.
IsCorruptedMnt
(
err
)
}
// 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
func
GetSecretForPod
(
pod
*
v1
.
Pod
,
secretName
string
,
kubeClient
clientset
.
Interface
)
(
map
[
string
]
string
,
error
)
{
func
GetSecretForPod
(
pod
*
v1
.
Pod
,
secretName
string
,
kubeClient
clientset
.
Interface
)
(
map
[
string
]
string
,
error
)
{
secret
:=
make
(
map
[
string
]
string
)
secret
:=
make
(
map
[
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