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
98392532
Commit
98392532
authored
May 25, 2015
by
Justin Santa Barbara
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add logging to volume tear-down to help understand mount behaviour
parent
9184ccf2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
3 deletions
+14
-3
mount.go
pkg/util/mount/mount.go
+9
-3
aws_ebs.go
pkg/volume/aws_ebs/aws_ebs.go
+5
-0
No files found.
pkg/util/mount/mount.go
View file @
98392532
...
...
@@ -18,6 +18,8 @@ limitations under the License.
// an alternate platform, we will need to abstract further.
package
mount
import
"github.com/golang/glog"
type
Interface
interface
{
// Mount mounts source to target as fstype with given options.
Mount
(
source
string
,
target
string
,
fstype
string
,
options
[]
string
)
error
...
...
@@ -66,9 +68,13 @@ func GetMountRefs(mounter Interface, mountPath string) ([]string, error) {
// Find all references to the device.
var
refs
[]
string
for
i
:=
range
mps
{
if
mps
[
i
]
.
Device
==
deviceName
&&
mps
[
i
]
.
Path
!=
mountPath
{
refs
=
append
(
refs
,
mps
[
i
]
.
Path
)
if
deviceName
==
""
{
glog
.
Warningf
(
"could not determine device for path: %s"
,
mountPath
)
}
else
{
for
i
:=
range
mps
{
if
mps
[
i
]
.
Device
==
deviceName
&&
mps
[
i
]
.
Path
!=
mountPath
{
refs
=
append
(
refs
,
mps
[
i
]
.
Path
)
}
}
}
return
refs
,
nil
...
...
pkg/volume/aws_ebs/aws_ebs.go
View file @
98392532
...
...
@@ -289,6 +289,9 @@ func (pd *awsElasticBlockStore) TearDownAt(dir string) error {
glog
.
V
(
2
)
.
Info
(
"Error getting mountrefs for "
,
dir
,
": "
,
err
)
return
err
}
if
len
(
refs
)
==
0
{
glog
.
Warning
(
"Did not find pod-mount for "
,
dir
,
" during tear-down"
)
}
// Unmount the bind-mount inside this pod
if
err
:=
pd
.
mounter
.
Unmount
(
dir
);
err
!=
nil
{
glog
.
V
(
2
)
.
Info
(
"Error unmounting dir "
,
dir
,
": "
,
err
)
...
...
@@ -307,6 +310,8 @@ func (pd *awsElasticBlockStore) TearDownAt(dir string) error {
glog
.
V
(
2
)
.
Info
(
"Error detaching disk "
,
pd
.
volumeID
,
": "
,
err
)
return
err
}
}
else
{
glog
.
V
(
2
)
.
Infof
(
"Found multiple refs; won't detach EBS volume: %v"
,
refs
)
}
mountpoint
,
mntErr
:=
pd
.
mounter
.
IsMountPoint
(
dir
)
if
mntErr
!=
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