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
f0cedd73
Commit
f0cedd73
authored
Apr 03, 2015
by
Justin Santa Barbara
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
More logging around error causes
Come back exceptions, all is forgiven!
parent
a366f9ee
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
0 deletions
+10
-0
aws_pd.go
pkg/volume/aws_pd/aws_pd.go
+6
-0
aws_util.go
pkg/volume/aws_pd/aws_util.go
+4
-0
No files found.
pkg/volume/aws_pd/aws_pd.go
View file @
f0cedd73
...
...
@@ -254,18 +254,22 @@ func (pd *awsPersistentDisk) TearDown() error {
func
(
pd
*
awsPersistentDisk
)
TearDownAt
(
dir
string
)
error
{
mountpoint
,
err
:=
mount
.
IsMountPoint
(
dir
)
if
err
!=
nil
{
glog
.
V
(
2
)
.
Info
(
"Error checking if mountpoint "
,
dir
,
": "
,
err
)
return
err
}
if
!
mountpoint
{
glog
.
V
(
2
)
.
Info
(
"Not mountpoint, deleting"
)
return
os
.
Remove
(
dir
)
}
refs
,
err
:=
mount
.
GetMountRefs
(
pd
.
mounter
,
dir
)
if
err
!=
nil
{
glog
.
V
(
2
)
.
Info
(
"Error getting mountrefs for "
,
dir
,
": "
,
err
)
return
err
}
// Unmount the bind-mount inside this pod
if
err
:=
pd
.
mounter
.
Unmount
(
dir
,
0
);
err
!=
nil
{
glog
.
V
(
2
)
.
Info
(
"Error unmounting dir "
,
dir
,
": "
,
err
)
return
err
}
// If len(refs) is 1, then all bind mounts have been removed, and the
...
...
@@ -274,6 +278,7 @@ func (pd *awsPersistentDisk) TearDownAt(dir string) error {
// pd.pdName is not initially set for volume-cleaners, so set it here.
pd
.
pdName
=
path
.
Base
(
refs
[
0
])
if
err
:=
pd
.
manager
.
DetachDisk
(
pd
);
err
!=
nil
{
glog
.
V
(
2
)
.
Info
(
"Error detaching disk "
,
pd
.
pdName
,
": "
,
err
)
return
err
}
}
...
...
@@ -284,6 +289,7 @@ func (pd *awsPersistentDisk) TearDownAt(dir string) error {
}
if
!
mountpoint
{
if
err
:=
os
.
Remove
(
dir
);
err
!=
nil
{
glog
.
V
(
2
)
.
Info
(
"Error removing mountpoint "
,
dir
,
": "
,
err
)
return
err
}
}
...
...
pkg/volume/aws_pd/aws_util.go
View file @
f0cedd73
...
...
@@ -91,17 +91,21 @@ func (util *AWSDiskUtil) DetachDisk(pd *awsPersistentDisk) error {
// Unmount the global PD mount, which should be the only one.
globalPDPath
:=
makeGlobalPDName
(
pd
.
plugin
.
host
,
pd
.
pdName
)
if
err
:=
pd
.
mounter
.
Unmount
(
globalPDPath
,
0
);
err
!=
nil
{
glog
.
V
(
2
)
.
Info
(
"Error unmount dir "
,
globalPDPath
,
": "
,
err
)
return
err
}
if
err
:=
os
.
Remove
(
globalPDPath
);
err
!=
nil
{
glog
.
V
(
2
)
.
Info
(
"Error removing dir "
,
globalPDPath
,
": "
,
err
)
return
err
}
// Detach the disk
volumes
,
err
:=
pd
.
getVolumeProvider
()
if
err
!=
nil
{
glog
.
V
(
2
)
.
Info
(
"Error getting volume provider for pd "
,
pd
.
pdName
,
": "
,
err
)
return
err
}
if
err
:=
volumes
.
DetachDisk
(
""
,
pd
.
pdName
);
err
!=
nil
{
glog
.
V
(
2
)
.
Info
(
"Error detaching disk "
,
pd
.
pdName
,
": "
,
err
)
return
err
}
return
nil
...
...
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