Commit f61a5d04 authored by Justin Santa Barbara's avatar Justin Santa Barbara

AWS: Switch arguments to AttachDisk/DetachDisk to match GCE

parent d10e3deb
...@@ -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, volumeName string, readOnly bool) (string, error) AttachDisk(diskName string, instanceName 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, volumeName string) (string, error) DetachDisk(diskName string, instanceName 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, diskName string, readOnly bool) (string, error) { func (c *AWSCloud) AttachDisk(diskName string, instanceName 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, diskName string) (string, error) { func (aws *AWSCloud) DetachDisk(diskName string, instanceName string) (string, error) {
disk, err := newAWSDisk(aws, diskName) disk, err := newAWSDisk(aws, diskName)
if err != nil { if err != nil {
return "", err return "", err
......
...@@ -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, volumeName string, readOnly bool) (string, error) { func (v *mockVolumes) AttachDisk(diskName string, instanceName string, readOnly bool) (string, error) {
return "", fmt.Errorf("not implemented") return "", fmt.Errorf("not implemented")
} }
func (v *mockVolumes) DetachDisk(instanceName string, volumeName string) (string, error) { func (v *mockVolumes) DetachDisk(diskName string, instanceName string) (string, error) {
return "", fmt.Errorf("not implemented") return "", fmt.Errorf("not implemented")
} }
......
...@@ -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, pdName) _, err := volumes.DetachDisk(pdName, hostName)
return err return err
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment