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
a20484b5
Commit
a20484b5
authored
Apr 07, 2015
by
Justin Santa Barbara
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Apply latest changes from copy-and-pasted gce_pd
parent
9711e771
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
8 deletions
+8
-8
aws_pd.go
pkg/volume/aws_pd/aws_pd.go
+5
-5
aws_pd_test.go
pkg/volume/aws_pd/aws_pd_test.go
+2
-2
aws_util.go
pkg/volume/aws_pd/aws_util.go
+1
-1
No files found.
pkg/volume/aws_pd/aws_pd.go
View file @
a20484b5
...
@@ -174,7 +174,7 @@ func (pd *awsElasticBlockStore) SetUp() error {
...
@@ -174,7 +174,7 @@ func (pd *awsElasticBlockStore) SetUp() error {
// SetUpAt attaches the disk and bind mounts to the volume path.
// SetUpAt attaches the disk and bind mounts to the volume path.
func
(
pd
*
awsElasticBlockStore
)
SetUpAt
(
dir
string
)
error
{
func
(
pd
*
awsElasticBlockStore
)
SetUpAt
(
dir
string
)
error
{
// TODO: handle failed mounts here.
// TODO: handle failed mounts here.
mountpoint
,
err
:=
mount
.
IsMountPoint
(
dir
)
mountpoint
,
err
:=
pd
.
mounter
.
IsMountPoint
(
dir
)
glog
.
V
(
4
)
.
Infof
(
"PersistentDisk set up: %s %v %v"
,
dir
,
mountpoint
,
err
)
glog
.
V
(
4
)
.
Infof
(
"PersistentDisk set up: %s %v %v"
,
dir
,
mountpoint
,
err
)
if
err
!=
nil
&&
!
os
.
IsNotExist
(
err
)
{
if
err
!=
nil
&&
!
os
.
IsNotExist
(
err
)
{
return
err
return
err
...
@@ -202,7 +202,7 @@ func (pd *awsElasticBlockStore) SetUpAt(dir string) error {
...
@@ -202,7 +202,7 @@ func (pd *awsElasticBlockStore) SetUpAt(dir string) error {
// Perform a bind mount to the full path to allow duplicate mounts of the same PD.
// Perform a bind mount to the full path to allow duplicate mounts of the same PD.
err
=
pd
.
mounter
.
Mount
(
globalPDPath
,
dir
,
""
,
mount
.
FlagBind
|
flags
,
""
)
err
=
pd
.
mounter
.
Mount
(
globalPDPath
,
dir
,
""
,
mount
.
FlagBind
|
flags
,
""
)
if
err
!=
nil
{
if
err
!=
nil
{
mountpoint
,
mntErr
:=
mount
.
IsMountPoint
(
dir
)
mountpoint
,
mntErr
:=
pd
.
mounter
.
IsMountPoint
(
dir
)
if
mntErr
!=
nil
{
if
mntErr
!=
nil
{
glog
.
Errorf
(
"isMountpoint check failed: %v"
,
mntErr
)
glog
.
Errorf
(
"isMountpoint check failed: %v"
,
mntErr
)
return
err
return
err
...
@@ -212,7 +212,7 @@ func (pd *awsElasticBlockStore) SetUpAt(dir string) error {
...
@@ -212,7 +212,7 @@ func (pd *awsElasticBlockStore) SetUpAt(dir string) error {
glog
.
Errorf
(
"Failed to unmount: %v"
,
mntErr
)
glog
.
Errorf
(
"Failed to unmount: %v"
,
mntErr
)
return
err
return
err
}
}
mountpoint
,
mntErr
:=
mount
.
IsMountPoint
(
dir
)
mountpoint
,
mntErr
:=
pd
.
mounter
.
IsMountPoint
(
dir
)
if
mntErr
!=
nil
{
if
mntErr
!=
nil
{
glog
.
Errorf
(
"isMountpoint check failed: %v"
,
mntErr
)
glog
.
Errorf
(
"isMountpoint check failed: %v"
,
mntErr
)
return
err
return
err
...
@@ -271,7 +271,7 @@ func (pd *awsElasticBlockStore) TearDown() error {
...
@@ -271,7 +271,7 @@ func (pd *awsElasticBlockStore) TearDown() error {
// Unmounts the bind mount, and detaches the disk only if the PD
// Unmounts the bind mount, and detaches the disk only if the PD
// resource was the last reference to that disk on the kubelet.
// resource was the last reference to that disk on the kubelet.
func
(
pd
*
awsElasticBlockStore
)
TearDownAt
(
dir
string
)
error
{
func
(
pd
*
awsElasticBlockStore
)
TearDownAt
(
dir
string
)
error
{
mountpoint
,
err
:=
mount
.
IsMountPoint
(
dir
)
mountpoint
,
err
:=
pd
.
mounter
.
IsMountPoint
(
dir
)
if
err
!=
nil
{
if
err
!=
nil
{
glog
.
V
(
2
)
.
Info
(
"Error checking if mountpoint "
,
dir
,
": "
,
err
)
glog
.
V
(
2
)
.
Info
(
"Error checking if mountpoint "
,
dir
,
": "
,
err
)
return
err
return
err
...
@@ -305,7 +305,7 @@ func (pd *awsElasticBlockStore) TearDownAt(dir string) error {
...
@@ -305,7 +305,7 @@ func (pd *awsElasticBlockStore) TearDownAt(dir string) error {
return
err
return
err
}
}
}
}
mountpoint
,
mntErr
:=
mount
.
IsMountPoint
(
dir
)
mountpoint
,
mntErr
:=
pd
.
mounter
.
IsMountPoint
(
dir
)
if
mntErr
!=
nil
{
if
mntErr
!=
nil
{
glog
.
Errorf
(
"isMountpoint check failed: %v"
,
mntErr
)
glog
.
Errorf
(
"isMountpoint check failed: %v"
,
mntErr
)
return
err
return
err
...
...
pkg/volume/aws_pd/aws_pd_test.go
View file @
a20484b5
...
@@ -111,7 +111,7 @@ func TestPlugin(t *testing.T) {
...
@@ -111,7 +111,7 @@ func TestPlugin(t *testing.T) {
t
.
Errorf
(
"Failed to make a new Builder: %v"
,
err
)
t
.
Errorf
(
"Failed to make a new Builder: %v"
,
err
)
}
}
if
builder
==
nil
{
if
builder
==
nil
{
t
.
Errorf
(
"Got a nil Builder
: %v
"
)
t
.
Errorf
(
"Got a nil Builder"
)
}
}
path
:=
builder
.
GetPath
()
path
:=
builder
.
GetPath
()
...
@@ -142,7 +142,7 @@ func TestPlugin(t *testing.T) {
...
@@ -142,7 +142,7 @@ func TestPlugin(t *testing.T) {
t
.
Errorf
(
"Failed to make a new Cleaner: %v"
,
err
)
t
.
Errorf
(
"Failed to make a new Cleaner: %v"
,
err
)
}
}
if
cleaner
==
nil
{
if
cleaner
==
nil
{
t
.
Errorf
(
"Got a nil Cleaner
: %v
"
)
t
.
Errorf
(
"Got a nil Cleaner"
)
}
}
if
err
:=
cleaner
.
TearDown
();
err
!=
nil
{
if
err
:=
cleaner
.
TearDown
();
err
!=
nil
{
...
...
pkg/volume/aws_pd/aws_util.go
View file @
a20484b5
...
@@ -65,7 +65,7 @@ func (util *AWSDiskUtil) AttachAndMountDisk(pd *awsElasticBlockStore, globalPDPa
...
@@ -65,7 +65,7 @@ func (util *AWSDiskUtil) AttachAndMountDisk(pd *awsElasticBlockStore, globalPDPa
}
}
// Only mount the PD globally once.
// Only mount the PD globally once.
mountpoint
,
err
:=
mount
.
IsMountPoint
(
globalPDPath
)
mountpoint
,
err
:=
pd
.
mounter
.
IsMountPoint
(
globalPDPath
)
if
err
!=
nil
{
if
err
!=
nil
{
if
os
.
IsNotExist
(
err
)
{
if
os
.
IsNotExist
(
err
)
{
if
err
:=
os
.
MkdirAll
(
globalPDPath
,
0750
);
err
!=
nil
{
if
err
:=
os
.
MkdirAll
(
globalPDPath
,
0750
);
err
!=
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