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
f61a5d04
Commit
f61a5d04
authored
Feb 03, 2016
by
Justin Santa Barbara
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
AWS: Switch arguments to AttachDisk/DetachDisk to match GCE
parent
d10e3deb
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
7 deletions
+7
-7
aws.go
pkg/cloudprovider/providers/aws/aws.go
+4
-4
admission_test.go
...in/pkg/admission/persistentvolume/label/admission_test.go
+2
-2
pd.go
test/e2e/pd.go
+1
-1
No files found.
pkg/cloudprovider/providers/aws/aws.go
View file @
f61a5d04
...
@@ -155,11 +155,11 @@ type Volumes interface {
...
@@ -155,11 +155,11 @@ type Volumes interface {
// Attach the disk to the specified instance
// Attach the disk to the specified instance
// instanceName can be empty to mean "the instance on which we are running"
// instanceName can be empty to mean "the instance on which we are running"
// Returns the device (e.g. /dev/xvdf) where we attached the volume
// Returns the device (e.g. /dev/xvdf) where we attached the volume
AttachDisk
(
instanceName
string
,
volum
eName
string
,
readOnly
bool
)
(
string
,
error
)
AttachDisk
(
diskName
string
,
instanc
eName
string
,
readOnly
bool
)
(
string
,
error
)
// Detach the disk from the specified instance
// Detach the disk from the specified instance
// instanceName can be empty to mean "the instance on which we are running"
// instanceName can be empty to mean "the instance on which we are running"
// Returns the device where the volume was attached
// Returns the device where the volume was attached
DetachDisk
(
instanceName
string
,
volum
eName
string
)
(
string
,
error
)
DetachDisk
(
diskName
string
,
instanc
eName
string
)
(
string
,
error
)
// Create a volume with the specified options
// Create a volume with the specified options
CreateDisk
(
volumeOptions
*
VolumeOptions
)
(
volumeName
string
,
err
error
)
CreateDisk
(
volumeOptions
*
VolumeOptions
)
(
volumeName
string
,
err
error
)
...
@@ -1172,7 +1172,7 @@ func (aws *AWSCloud) getAwsInstance(nodeName string) (*awsInstance, error) {
...
@@ -1172,7 +1172,7 @@ func (aws *AWSCloud) getAwsInstance(nodeName string) (*awsInstance, error) {
}
}
// Implements Volumes.AttachDisk
// Implements Volumes.AttachDisk
func
(
c
*
AWSCloud
)
AttachDisk
(
instanceName
string
,
disk
Name
string
,
readOnly
bool
)
(
string
,
error
)
{
func
(
c
*
AWSCloud
)
AttachDisk
(
diskName
string
,
instance
Name
string
,
readOnly
bool
)
(
string
,
error
)
{
disk
,
err
:=
newAWSDisk
(
c
,
diskName
)
disk
,
err
:=
newAWSDisk
(
c
,
diskName
)
if
err
!=
nil
{
if
err
!=
nil
{
return
""
,
err
return
""
,
err
...
@@ -1237,7 +1237,7 @@ func (c *AWSCloud) AttachDisk(instanceName string, diskName string, readOnly boo
...
@@ -1237,7 +1237,7 @@ func (c *AWSCloud) AttachDisk(instanceName string, diskName string, readOnly boo
}
}
// Implements Volumes.DetachDisk
// Implements Volumes.DetachDisk
func
(
aws
*
AWSCloud
)
DetachDisk
(
instanceName
string
,
disk
Name
string
)
(
string
,
error
)
{
func
(
aws
*
AWSCloud
)
DetachDisk
(
diskName
string
,
instance
Name
string
)
(
string
,
error
)
{
disk
,
err
:=
newAWSDisk
(
aws
,
diskName
)
disk
,
err
:=
newAWSDisk
(
aws
,
diskName
)
if
err
!=
nil
{
if
err
!=
nil
{
return
""
,
err
return
""
,
err
...
...
plugin/pkg/admission/persistentvolume/label/admission_test.go
View file @
f61a5d04
...
@@ -33,11 +33,11 @@ type mockVolumes struct {
...
@@ -33,11 +33,11 @@ type mockVolumes struct {
var
_
aws
.
Volumes
=
&
mockVolumes
{}
var
_
aws
.
Volumes
=
&
mockVolumes
{}
func
(
v
*
mockVolumes
)
AttachDisk
(
instanceName
string
,
volum
eName
string
,
readOnly
bool
)
(
string
,
error
)
{
func
(
v
*
mockVolumes
)
AttachDisk
(
diskName
string
,
instanc
eName
string
,
readOnly
bool
)
(
string
,
error
)
{
return
""
,
fmt
.
Errorf
(
"not implemented"
)
return
""
,
fmt
.
Errorf
(
"not implemented"
)
}
}
func
(
v
*
mockVolumes
)
DetachDisk
(
instanceName
string
,
volum
eName
string
)
(
string
,
error
)
{
func
(
v
*
mockVolumes
)
DetachDisk
(
diskName
string
,
instanc
eName
string
)
(
string
,
error
)
{
return
""
,
fmt
.
Errorf
(
"not implemented"
)
return
""
,
fmt
.
Errorf
(
"not implemented"
)
}
}
...
...
test/e2e/pd.go
View file @
f61a5d04
...
@@ -391,7 +391,7 @@ func detachPD(hostName, pdName string) error {
...
@@ -391,7 +391,7 @@ func detachPD(hostName, pdName string) error {
if
!
ok
{
if
!
ok
{
return
fmt
.
Errorf
(
"Provider does not support volumes"
)
return
fmt
.
Errorf
(
"Provider does not support volumes"
)
}
}
_
,
err
:=
volumes
.
DetachDisk
(
hostName
,
pd
Name
)
_
,
err
:=
volumes
.
DetachDisk
(
pdName
,
host
Name
)
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