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
3689bf02
Commit
3689bf02
authored
Apr 03, 2015
by
Justin Santa Barbara
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix pd name parse
parent
21beabd0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
5 deletions
+7
-5
aws_pd.go
pkg/volume/aws_pd/aws_pd.go
+7
-5
No files found.
pkg/volume/aws_pd/aws_pd.go
View file @
3689bf02
...
@@ -20,6 +20,7 @@ import (
...
@@ -20,6 +20,7 @@ import (
"fmt"
"fmt"
"os"
"os"
"path"
"path"
"path/filepath"
"strconv"
"strconv"
"strings"
"strings"
...
@@ -248,11 +249,12 @@ func getPdNameFromGlobalMount(host volume.VolumeHost, globalPath string) (string
...
@@ -248,11 +249,12 @@ func getPdNameFromGlobalMount(host volume.VolumeHost, globalPath string) (string
return
""
,
fmt
.
Errorf
(
"Unexpected mount path: "
+
globalPath
)
return
""
,
fmt
.
Errorf
(
"Unexpected mount path: "
+
globalPath
)
}
}
// Reverse the :// replacement done in makeGlobalPDName
// Reverse the :// replacement done in makeGlobalPDName
n
ame
:=
rel
pdN
ame
:=
rel
if
strings
.
HasPrefix
(
n
ame
,
"aws/"
)
{
if
strings
.
HasPrefix
(
pdN
ame
,
"aws/"
)
{
name
=
strings
.
Replace
(
name
,
"aws/"
,
"aws://"
)
pdName
=
strings
.
Replace
(
pdName
,
"aws/"
,
"aws://"
,
1
)
}
}
return
name
,
nil
glog
.
V
(
2
)
.
Info
(
"Mapping mount dir "
,
globalPath
,
" to pdName "
,
pdName
)
return
pdName
,
nil
}
}
func
(
pd
*
awsPersistentDisk
)
GetPath
()
string
{
func
(
pd
*
awsPersistentDisk
)
GetPath
()
string
{
...
@@ -293,7 +295,7 @@ func (pd *awsPersistentDisk) TearDownAt(dir string) error {
...
@@ -293,7 +295,7 @@ func (pd *awsPersistentDisk) TearDownAt(dir string) error {
// remaining reference is the global mount. It is safe to detach.
// remaining reference is the global mount. It is safe to detach.
if
len
(
refs
)
==
1
{
if
len
(
refs
)
==
1
{
// pd.pdName is not initially set for volume-cleaners, so set it here.
// pd.pdName is not initially set for volume-cleaners, so set it here.
pd
.
pdName
,
err
=
getPdNameFromGlobalMount
(
refs
[
0
])
pd
.
pdName
,
err
=
getPdNameFromGlobalMount
(
pd
.
plugin
.
host
,
refs
[
0
])
if
err
!=
nil
{
if
err
!=
nil
{
glog
.
V
(
2
)
.
Info
(
"Could not determine pdName from mountpoint "
,
refs
[
0
],
": "
,
err
)
glog
.
V
(
2
)
.
Info
(
"Could not determine pdName from mountpoint "
,
refs
[
0
],
": "
,
err
)
return
err
return
err
...
...
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