mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-24 04:06:03 +00:00
AWS: Switch arguments to AttachDisk/DetachDisk to match GCE
This commit is contained in:
parent
d10e3debc7
commit
f61a5d0400
@ -155,11 +155,11 @@ type Volumes interface {
|
||||
// Attach the disk to the specified instance
|
||||
// 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
|
||||
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
|
||||
// instanceName can be empty to mean "the instance on which we are running"
|
||||
// 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
|
||||
CreateDisk(volumeOptions *VolumeOptions) (volumeName string, err error)
|
||||
@ -1172,7 +1172,7 @@ func (aws *AWSCloud) getAwsInstance(nodeName string) (*awsInstance, error) {
|
||||
}
|
||||
|
||||
// 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)
|
||||
if err != nil {
|
||||
return "", err
|
||||
@ -1237,7 +1237,7 @@ func (c *AWSCloud) AttachDisk(instanceName string, diskName string, readOnly boo
|
||||
}
|
||||
|
||||
// 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)
|
||||
if err != nil {
|
||||
return "", err
|
||||
|
@ -33,11 +33,11 @@ type mockVolumes struct {
|
||||
|
||||
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")
|
||||
}
|
||||
|
||||
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")
|
||||
}
|
||||
|
||||
|
@ -391,7 +391,7 @@ func detachPD(hostName, pdName string) error {
|
||||
if !ok {
|
||||
return fmt.Errorf("Provider does not support volumes")
|
||||
}
|
||||
_, err := volumes.DetachDisk(hostName, pdName)
|
||||
_, err := volumes.DetachDisk(pdName, hostName)
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user