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
4b25a4fd
Commit
4b25a4fd
authored
Jan 28, 2019
by
qingsenLi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix some typos in /pkg/volume
parent
8b98e802
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
7 deletions
+7
-7
fc_util.go
pkg/volume/fc/fc_util.go
+1
-1
operation_generator.go
pkg/volume/util/operationexecutor/operation_generator.go
+3
-3
volume_path_handler.go
pkg/volume/util/volumepathhandler/volume_path_handler.go
+3
-3
No files found.
pkg/volume/fc/fc_util.go
View file @
4b25a4fd
...
...
@@ -319,7 +319,7 @@ func (util *fcUtil) DetachBlockFCDisk(c fcDiskUnmapper, mapPath, devicePath stri
}
volumeInfo
:=
arr
[
len
(
arr
)
-
1
]
// Search symbolic
k
link which matches volumeInfo under /dev/disk/by-path or /dev/disk/by-id
// Search symbolic link which matches volumeInfo under /dev/disk/by-path or /dev/disk/by-id
// then find destination device path from the link
searchPath
:=
byID
if
strings
.
Contains
(
volumeInfo
,
"-lun-"
)
{
...
...
pkg/volume/util/operationexecutor/operation_generator.go
View file @
4b25a4fd
...
...
@@ -803,7 +803,7 @@ func (og *operationGenerator) GenerateUnmountDeviceFunc(
// After setup is done, create symbolic links on both global map path and pod
// device map path. Once symbolic links are created, take fd lock by
// loopback for the device to avoid silent volume replacement. This lock
// will be re
al
ased once no one uses the device.
// will be re
le
ased once no one uses the device.
// If all steps are completed, the volume is marked as mounted.
func
(
og
*
operationGenerator
)
GenerateMapVolumeFunc
(
waitForAttachTimeout
time
.
Duration
,
...
...
@@ -1033,7 +1033,7 @@ func (og *operationGenerator) GenerateUnmapVolumeFunc(
// GenerateUnmapDeviceFunc marks device as unmounted based on following steps.
// Check under globalMapPath dir if there isn't pod's symbolic links in it.
// If symbolic
k
link isn't there, the device isn't referenced from Pods.
// If symbolic link isn't there, the device isn't referenced from Pods.
// Call plugin TearDownDevice to clean-up device connection, stored data under
// globalMapPath, these operations depend on plugin implementation.
// Once TearDownDevice is completed, remove globalMapPath dir.
...
...
@@ -1064,7 +1064,7 @@ func (og *operationGenerator) GenerateUnmapDeviceFunc(
unmapDeviceFunc
:=
func
()
(
error
,
error
)
{
// Search under globalMapPath dir if all symbolic links from pods have been removed already.
// If symbolic
k
links are there, pods may still refer the volume.
// If symbolic links are there, pods may still refer the volume.
globalMapPath
:=
deviceToDetach
.
DeviceMountPath
refs
,
err
:=
og
.
blkUtil
.
GetDeviceSymlinkRefs
(
deviceToDetach
.
DevicePath
,
globalMapPath
)
if
err
!=
nil
{
...
...
pkg/volume/util/volumepathhandler/volume_path_handler.go
View file @
4b25a4fd
...
...
@@ -144,16 +144,16 @@ func (v VolumePathHandler) RemoveMapPath(mapPath string) error {
}
// IsSymlinkExist returns true if specified file exists and the type is symbolik link.
// If file doesn't exist, or file exists but not symbolic
k
link, return false with no error.
// If file doesn't exist, or file exists but not symbolic link, return false with no error.
// On other cases, return false with error from Lstat().
func
(
v
VolumePathHandler
)
IsSymlinkExist
(
mapPath
string
)
(
bool
,
error
)
{
fi
,
err
:=
os
.
Lstat
(
mapPath
)
if
err
==
nil
{
// If file exits and it's symbolic
k
link, return true and no error
// If file exits and it's symbolic link, return true and no error
if
fi
.
Mode
()
&
os
.
ModeSymlink
==
os
.
ModeSymlink
{
return
true
,
nil
}
// If file exits but it's not symbolic
k
link, return fale and no error
// If file exits but it's not symbolic link, return fale and no error
return
false
,
nil
}
// If file doesn't exist, return false and no error
...
...
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