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
64c84aa6
Commit
64c84aa6
authored
Apr 18, 2019
by
PingWang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
delete some unused code for awsebs
Signed-off-by:
PingWang
<
wang.ping5@zte.com.cn
>
parent
7e027697
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
41 deletions
+0
-41
aws_ebs.go
pkg/volume/awsebs/aws_ebs.go
+0
-21
aws_util.go
pkg/volume/awsebs/aws_util.go
+0
-20
No files found.
pkg/volume/awsebs/aws_ebs.go
View file @
64c84aa6
...
@@ -454,27 +454,6 @@ func makeGlobalPDPath(host volume.VolumeHost, volumeID aws.KubernetesVolumeID) s
...
@@ -454,27 +454,6 @@ func makeGlobalPDPath(host volume.VolumeHost, volumeID aws.KubernetesVolumeID) s
return
filepath
.
Join
(
host
.
GetPluginDir
(
awsElasticBlockStorePluginName
),
mount
.
MountsInGlobalPDPath
,
name
)
return
filepath
.
Join
(
host
.
GetPluginDir
(
awsElasticBlockStorePluginName
),
mount
.
MountsInGlobalPDPath
,
name
)
}
}
// Reverses the mapping done in makeGlobalPDPath
func
getVolumeIDFromGlobalMount
(
host
volume
.
VolumeHost
,
globalPath
string
)
(
string
,
error
)
{
basePath
:=
filepath
.
Join
(
host
.
GetPluginDir
(
awsElasticBlockStorePluginName
),
mount
.
MountsInGlobalPDPath
)
rel
,
err
:=
filepath
.
Rel
(
basePath
,
globalPath
)
if
err
!=
nil
{
klog
.
Errorf
(
"Failed to get volume id from global mount %s - %v"
,
globalPath
,
err
)
return
""
,
err
}
if
strings
.
Contains
(
rel
,
"../"
)
{
klog
.
Errorf
(
"Unexpected mount path: %s"
,
globalPath
)
return
""
,
fmt
.
Errorf
(
"unexpected mount path: "
+
globalPath
)
}
// Reverse the :// replacement done in makeGlobalPDPath
volumeID
:=
rel
if
strings
.
HasPrefix
(
volumeID
,
"aws/"
)
{
volumeID
=
strings
.
Replace
(
volumeID
,
"aws/"
,
"aws://"
,
1
)
}
klog
.
V
(
2
)
.
Info
(
"Mapping mount dir "
,
globalPath
,
" to volumeID "
,
volumeID
)
return
volumeID
,
nil
}
func
(
ebs
*
awsElasticBlockStore
)
GetPath
()
string
{
func
(
ebs
*
awsElasticBlockStore
)
GetPath
()
string
{
return
getPath
(
ebs
.
podUID
,
ebs
.
volName
,
ebs
.
plugin
.
host
)
return
getPath
(
ebs
.
podUID
,
ebs
.
volName
,
ebs
.
plugin
.
host
)
}
}
...
...
pkg/volume/awsebs/aws_util.go
View file @
64c84aa6
...
@@ -39,13 +39,7 @@ import (
...
@@ -39,13 +39,7 @@ import (
const
(
const
(
diskPartitionSuffix
=
""
diskPartitionSuffix
=
""
diskXVDPath
=
"/dev/xvd"
diskXVDPattern
=
"/dev/xvd*"
maxChecks
=
60
maxRetries
=
10
checkSleepDuration
=
time
.
Second
checkSleepDuration
=
time
.
Second
errorSleepDuration
=
5
*
time
.
Second
ebsMaxReplicasInAZ
=
1
)
)
// AWSDiskUtil provides operations for EBS volume.
// AWSDiskUtil provides operations for EBS volume.
...
@@ -201,20 +195,6 @@ func verifyDevicePath(devicePaths []string) (string, error) {
...
@@ -201,20 +195,6 @@ func verifyDevicePath(devicePaths []string) (string, error) {
return
""
,
nil
return
""
,
nil
}
}
// Returns the first path that exists, or empty string if none exist.
func
verifyAllPathsRemoved
(
devicePaths
[]
string
)
(
bool
,
error
)
{
allPathsRemoved
:=
true
for
_
,
path
:=
range
devicePaths
{
exists
,
err
:=
mount
.
PathExists
(
path
)
if
err
!=
nil
{
return
false
,
fmt
.
Errorf
(
"Error checking if path exists: %v"
,
err
)
}
allPathsRemoved
=
allPathsRemoved
&&
!
exists
}
return
allPathsRemoved
,
nil
}
// Returns list of all paths for given EBS mount
// Returns list of all paths for given EBS mount
// This is more interesting on GCE (where we are able to identify volumes under /dev/disk-by-id)
// This is more interesting on GCE (where we are able to identify volumes under /dev/disk-by-id)
// Here it is mostly about applying the partition path
// Here it is mostly about applying the partition path
...
...
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