Style: volumeId -> volumeID

This commit is contained in:
Justin Santa Barbara 2015-04-09 06:34:16 -07:00
parent 98c9ebbc50
commit 933cf60af7
13 changed files with 63 additions and 63 deletions

View File

@ -407,7 +407,7 @@ type ISCSIVolumeSource struct {
// A AWS EBS disk can only be mounted as read/write once. // A AWS EBS disk can only be mounted as read/write once.
type AWSElasticBlockStoreVolumeSource struct { type AWSElasticBlockStoreVolumeSource struct {
// Unique id of the persistent disk resource. Used to identify the disk in AWS // Unique id of the persistent disk resource. Used to identify the disk in AWS
VolumeId string `json:"volumeId"` VolumeID string `json:"volumeID"`
// Required: Filesystem type to mount. // Required: Filesystem type to mount.
// Must be a filesystem type supported by the host operating system. // Must be a filesystem type supported by the host operating system.
// Ex. "ext4", "xfs", "ntfs" // Ex. "ext4", "xfs", "ntfs"

View File

@ -315,7 +315,7 @@ type ISCSIVolumeSource struct {
// A AWS PD can only be mounted on a single machine. // A AWS PD can only be mounted on a single machine.
type AWSElasticBlockStoreVolumeSource struct { type AWSElasticBlockStoreVolumeSource struct {
// Unique id of the PD resource. Used to identify the disk in AWS // Unique id of the PD resource. Used to identify the disk in AWS
VolumeId string `json:"volumeId" description:"unique id of the PD resource in AWS"` VolumeID string `json:"volumeID" description:"unique id of the PD resource in AWS"`
// Required: Filesystem type to mount. // Required: Filesystem type to mount.
// Must be a filesystem type supported by the host operating system. // Must be a filesystem type supported by the host operating system.
// Ex. "ext4", "xfs", "ntfs" // Ex. "ext4", "xfs", "ntfs"

View File

@ -297,7 +297,7 @@ type GCEPersistentDiskVolumeSource struct {
// A AWS PD can only be mounted on a single machine. // A AWS PD can only be mounted on a single machine.
type AWSElasticBlockStoreVolumeSource struct { type AWSElasticBlockStoreVolumeSource struct {
// Unique id of the PD resource. Used to identify the disk in AWS // Unique id of the PD resource. Used to identify the disk in AWS
VolumeId string `json:"volumeId" description:"unique id of the PD resource in AWS"` VolumeID string `json:"volumeID" description:"unique id of the PD resource in AWS"`
// Required: Filesystem type to mount. // Required: Filesystem type to mount.
// Must be a filesystem type supported by the host operating system. // Must be a filesystem type supported by the host operating system.
// Ex. "ext4", "xfs", "ntfs" // Ex. "ext4", "xfs", "ntfs"

View File

@ -413,7 +413,7 @@ type GCEPersistentDiskVolumeSource struct {
// A AWS PD can only be mounted on a single machine. // A AWS PD can only be mounted on a single machine.
type AWSElasticBlockStoreVolumeSource struct { type AWSElasticBlockStoreVolumeSource struct {
// Unique id of the PD resource. Used to identify the disk in AWS // Unique id of the PD resource. Used to identify the disk in AWS
VolumeId string `json:"volumeId" description:"unique id of the PD resource in AWS"` VolumeID string `json:"volumeID" description:"unique id of the PD resource in AWS"`
// Required: Filesystem type to mount. // Required: Filesystem type to mount.
// Must be a filesystem type supported by the host operating system. // Must be a filesystem type supported by the host operating system.
// Ex. "ext4", "xfs", "ntfs" // Ex. "ext4", "xfs", "ntfs"

View File

@ -374,8 +374,8 @@ func validateGCEPersistentDiskVolumeSource(PD *api.GCEPersistentDiskVolumeSource
func validateAWSElasticBlockStoreVolumeSource(PD *api.AWSElasticBlockStoreVolumeSource) errs.ValidationErrorList { func validateAWSElasticBlockStoreVolumeSource(PD *api.AWSElasticBlockStoreVolumeSource) errs.ValidationErrorList {
allErrs := errs.ValidationErrorList{} allErrs := errs.ValidationErrorList{}
if PD.VolumeId == "" { if PD.VolumeID == "" {
allErrs = append(allErrs, errs.NewFieldRequired("volumeId")) allErrs = append(allErrs, errs.NewFieldRequired("volumeID"))
} }
if PD.FSType == "" { if PD.FSType == "" {
allErrs = append(allErrs, errs.NewFieldRequired("fsType")) allErrs = append(allErrs, errs.NewFieldRequired("fsType"))

View File

@ -44,16 +44,16 @@ type EC2 interface {
Instances(instIds []string, filter *ec2InstanceFilter) (resp *ec2.InstancesResp, err error) Instances(instIds []string, filter *ec2InstanceFilter) (resp *ec2.InstancesResp, err error)
// Attach a volume to an instance // Attach a volume to an instance
AttachVolume(volumeId string, instanceId string, mountDevice string) (resp *ec2.AttachVolumeResp, err error) AttachVolume(volumeID string, instanceId string, mountDevice string) (resp *ec2.AttachVolumeResp, err error)
// Detach a volume from whatever instance it is attached to // Detach a volume from whatever instance it is attached to
// TODO: We should specify the InstanceID and the Device, for safety // TODO: We should specify the InstanceID and the Device, for safety
DetachVolume(volumeId string) (resp *ec2.SimpleResp, err error) DetachVolume(volumeID string) (resp *ec2.SimpleResp, err error)
// Lists volumes // Lists volumes
Volumes(volumeIds []string, filter *ec2.Filter) (resp *ec2.VolumesResp, err error) Volumes(volumeIDs []string, filter *ec2.Filter) (resp *ec2.VolumesResp, err error)
// Create an EBS volume // Create an EBS volume
CreateVolume(request *ec2.CreateVolume) (resp *ec2.CreateVolumeResp, err error) CreateVolume(request *ec2.CreateVolume) (resp *ec2.CreateVolumeResp, err error)
// Delete an EBS volume // Delete an EBS volume
DeleteVolume(volumeId string) (resp *ec2.SimpleResp, err error) DeleteVolume(volumeID string) (resp *ec2.SimpleResp, err error)
} }
// Abstraction over the AWS metadata service // Abstraction over the AWS metadata service
@ -147,24 +147,24 @@ func (self *goamzMetadata) GetMetaData(key string) ([]byte, error) {
type AuthFunc func() (auth aws.Auth, err error) type AuthFunc func() (auth aws.Auth, err error)
func (s *goamzEC2) AttachVolume(volumeId string, instanceId string, device string) (resp *ec2.AttachVolumeResp, err error) { func (s *goamzEC2) AttachVolume(volumeID string, instanceId string, device string) (resp *ec2.AttachVolumeResp, err error) {
return s.ec2.AttachVolume(volumeId, instanceId, device) return s.ec2.AttachVolume(volumeID, instanceId, device)
} }
func (s *goamzEC2) DetachVolume(volumeId string) (resp *ec2.SimpleResp, err error) { func (s *goamzEC2) DetachVolume(volumeID string) (resp *ec2.SimpleResp, err error) {
return s.ec2.DetachVolume(volumeId) return s.ec2.DetachVolume(volumeID)
} }
func (s *goamzEC2) Volumes(volumeIds []string, filter *ec2.Filter) (resp *ec2.VolumesResp, err error) { func (s *goamzEC2) Volumes(volumeIDs []string, filter *ec2.Filter) (resp *ec2.VolumesResp, err error) {
return s.ec2.Volumes(volumeIds, filter) return s.ec2.Volumes(volumeIDs, filter)
} }
func (s *goamzEC2) CreateVolume(request *ec2.CreateVolume) (resp *ec2.CreateVolumeResp, err error) { func (s *goamzEC2) CreateVolume(request *ec2.CreateVolume) (resp *ec2.CreateVolumeResp, err error) {
return s.ec2.CreateVolume(request) return s.ec2.CreateVolume(request)
} }
func (s *goamzEC2) DeleteVolume(volumeId string) (resp *ec2.SimpleResp, err error) { func (s *goamzEC2) DeleteVolume(volumeID string) (resp *ec2.SimpleResp, err error) {
return s.ec2.DeleteVolume(volumeId) return s.ec2.DeleteVolume(volumeID)
} }
func init() { func init() {
@ -641,7 +641,7 @@ func (self *awsInstance) getInfo() (*ec2.Instance, error) {
// Assigns an unused mount device for the specified volume. // Assigns an unused mount device for the specified volume.
// If the volume is already assigned, this will return the existing mount device and true // If the volume is already assigned, this will return the existing mount device and true
func (self *awsInstance) assignMountDevice(volumeId string) (mountDevice string, alreadyAttached bool, err error) { func (self *awsInstance) assignMountDevice(volumeID string) (mountDevice string, alreadyAttached bool, err error) {
instanceType := self.getInstanceType() instanceType := self.getInstanceType()
if instanceType == nil { if instanceType == nil {
return "", false, fmt.Errorf("could not get instance type for instance: %s", self.awsID) return "", false, fmt.Errorf("could not get instance type for instance: %s", self.awsID)
@ -661,15 +661,15 @@ func (self *awsInstance) assignMountDevice(volumeId string) (mountDevice string,
} }
deviceMappings := map[string]string{} deviceMappings := map[string]string{}
for _, blockDevice := range info.BlockDevices { for _, blockDevice := range info.BlockDevices {
deviceMappings[blockDevice.DeviceName] = blockDevice.VolumeId deviceMappings[blockDevice.DeviceName] = blockDevice.VolumeID
} }
self.deviceMappings = deviceMappings self.deviceMappings = deviceMappings
} }
// Check to see if this volume is already assigned a device on this machine // Check to see if this volume is already assigned a device on this machine
for deviceName, mappingVolumeId := range self.deviceMappings { for deviceName, mappingVolumeID := range self.deviceMappings {
if volumeId == mappingVolumeId { if volumeID == mappingVolumeID {
glog.Warningf("Got assignment call for already-assigned volume: %s@%s", deviceName, mappingVolumeId) glog.Warningf("Got assignment call for already-assigned volume: %s@%s", deviceName, mappingVolumeID)
return deviceName, true, nil return deviceName, true, nil
} }
} }
@ -690,26 +690,26 @@ func (self *awsInstance) assignMountDevice(volumeId string) (mountDevice string,
return "", false, nil return "", false, nil
} }
self.deviceMappings[chosen] = volumeId self.deviceMappings[chosen] = volumeID
glog.V(2).Infof("Assigned mount device %s -> volume %s", chosen, volumeId) glog.V(2).Infof("Assigned mount device %s -> volume %s", chosen, volumeID)
return chosen, false, nil return chosen, false, nil
} }
func (self *awsInstance) releaseMountDevice(volumeId string, mountDevice string) { func (self *awsInstance) releaseMountDevice(volumeID string, mountDevice string) {
self.mutex.Lock() self.mutex.Lock()
defer self.mutex.Unlock() defer self.mutex.Unlock()
existingVolumeId, found := self.deviceMappings[mountDevice] existingVolumeID, found := self.deviceMappings[mountDevice]
if !found { if !found {
glog.Errorf("releaseMountDevice on non-allocated device") glog.Errorf("releaseMountDevice on non-allocated device")
return return
} }
if volumeId != existingVolumeId { if volumeID != existingVolumeID {
glog.Errorf("releaseMountDevice on device assigned to different volume") glog.Errorf("releaseMountDevice on device assigned to different volume")
return return
} }
glog.V(2).Infof("Releasing mount device mapping: %s -> volume %s", mountDevice, volumeId) glog.V(2).Infof("Releasing mount device mapping: %s -> volume %s", mountDevice, volumeID)
delete(self.deviceMappings, mountDevice) delete(self.deviceMappings, mountDevice)
} }
@ -938,7 +938,7 @@ func (aws *AWSCloud) CreateVolume(volumeOptions *VolumeOptions) (string, error)
} }
az := response.AvailZone az := response.AvailZone
awsID := response.VolumeId awsID := response.VolumeID
volumeName := "aws://" + az + "/" + awsID volumeName := "aws://" + az + "/" + awsID

View File

@ -191,15 +191,15 @@ func (self *FakeMetadata) GetMetaData(key string) ([]byte, error) {
} }
} }
func (ec2 *FakeEC2) AttachVolume(volumeId string, instanceId string, mountDevice string) (resp *ec2.AttachVolumeResp, err error) { func (ec2 *FakeEC2) AttachVolume(volumeID string, instanceId string, mountDevice string) (resp *ec2.AttachVolumeResp, err error) {
panic("Not implemented") panic("Not implemented")
} }
func (ec2 *FakeEC2) DetachVolume(volumeId string) (resp *ec2.SimpleResp, err error) { func (ec2 *FakeEC2) DetachVolume(volumeID string) (resp *ec2.SimpleResp, err error) {
panic("Not implemented") panic("Not implemented")
} }
func (ec2 *FakeEC2) Volumes(volumeIds []string, filter *ec2.Filter) (resp *ec2.VolumesResp, err error) { func (ec2 *FakeEC2) Volumes(volumeIDs []string, filter *ec2.Filter) (resp *ec2.VolumesResp, err error) {
panic("Not implemented") panic("Not implemented")
} }
@ -207,7 +207,7 @@ func (ec2 *FakeEC2) CreateVolume(request *ec2.CreateVolume) (resp *ec2.CreateVol
panic("Not implemented") panic("Not implemented")
} }
func (ec2 *FakeEC2) DeleteVolume(volumeId string) (resp *ec2.SimpleResp, err error) { func (ec2 *FakeEC2) DeleteVolume(volumeID string) (resp *ec2.SimpleResp, err error) {
panic("Not implemented") panic("Not implemented")
} }

View File

@ -62,12 +62,12 @@ func isVolumeConflict(volume api.Volume, pod *api.Pod) bool {
} }
} }
if volume.AWSElasticBlockStore != nil { if volume.AWSElasticBlockStore != nil {
volumeId := volume.AWSElasticBlockStore.VolumeId volumeID := volume.AWSElasticBlockStore.VolumeID
manifest := &(pod.Spec) manifest := &(pod.Spec)
for ix := range manifest.Volumes { for ix := range manifest.Volumes {
if manifest.Volumes[ix].AWSElasticBlockStore != nil && if manifest.Volumes[ix].AWSElasticBlockStore != nil &&
manifest.Volumes[ix].AWSElasticBlockStore.VolumeId == volumeId { manifest.Volumes[ix].AWSElasticBlockStore.VolumeID == volumeID {
return true return true
} }
} }

View File

@ -327,7 +327,7 @@ func TestAWSDiskConflicts(t *testing.T) {
{ {
VolumeSource: api.VolumeSource{ VolumeSource: api.VolumeSource{
AWSElasticBlockStore: &api.AWSElasticBlockStoreVolumeSource{ AWSElasticBlockStore: &api.AWSElasticBlockStoreVolumeSource{
VolumeId: "foo", VolumeID: "foo",
}, },
}, },
}, },
@ -338,7 +338,7 @@ func TestAWSDiskConflicts(t *testing.T) {
{ {
VolumeSource: api.VolumeSource{ VolumeSource: api.VolumeSource{
AWSElasticBlockStore: &api.AWSElasticBlockStoreVolumeSource{ AWSElasticBlockStore: &api.AWSElasticBlockStoreVolumeSource{
VolumeId: "bar", VolumeID: "bar",
}, },
}, },
}, },

View File

@ -77,7 +77,7 @@ func (plugin *awsElasticBlockStorePlugin) NewBuilder(spec *api.Volume, podRef *a
} }
func (plugin *awsElasticBlockStorePlugin) newBuilderInternal(spec *api.Volume, podUID types.UID, manager pdManager, mounter mount.Interface) (volume.Builder, error) { func (plugin *awsElasticBlockStorePlugin) newBuilderInternal(spec *api.Volume, podUID types.UID, manager pdManager, mounter mount.Interface) (volume.Builder, error) {
volumeId := spec.AWSElasticBlockStore.VolumeId volumeID := spec.AWSElasticBlockStore.VolumeID
fsType := spec.AWSElasticBlockStore.FSType fsType := spec.AWSElasticBlockStore.FSType
partition := "" partition := ""
if spec.AWSElasticBlockStore.Partition != 0 { if spec.AWSElasticBlockStore.Partition != 0 {
@ -88,7 +88,7 @@ func (plugin *awsElasticBlockStorePlugin) newBuilderInternal(spec *api.Volume, p
return &awsElasticBlockStore{ return &awsElasticBlockStore{
podUID: podUID, podUID: podUID,
volName: spec.Name, volName: spec.Name,
volumeId: volumeId, volumeID: volumeID,
fsType: fsType, fsType: fsType,
partition: partition, partition: partition,
readOnly: readOnly, readOnly: readOnly,
@ -129,7 +129,7 @@ type awsElasticBlockStore struct {
volName string volName string
podUID types.UID podUID types.UID
// Unique id of the PD, used to find the disk resource in the provider. // Unique id of the PD, used to find the disk resource in the provider.
volumeId string volumeID string
// Filesystem type, optional. // Filesystem type, optional.
fsType string fsType string
// Specifies the partition to mount // Specifies the partition to mount
@ -183,7 +183,7 @@ func (pd *awsElasticBlockStore) SetUpAt(dir string) error {
return nil return nil
} }
globalPDPath := makeGlobalPDPath(pd.plugin.host, pd.volumeId) globalPDPath := makeGlobalPDPath(pd.plugin.host, pd.volumeID)
if err := pd.manager.AttachAndMountDisk(pd, globalPDPath); err != nil { if err := pd.manager.AttachAndMountDisk(pd, globalPDPath); err != nil {
return err return err
} }
@ -232,14 +232,14 @@ func (pd *awsElasticBlockStore) SetUpAt(dir string) error {
return nil return nil
} }
func makeGlobalPDPath(host volume.VolumeHost, volumeId string) string { func makeGlobalPDPath(host volume.VolumeHost, volumeID string) string {
// Clean up the URI to be more fs-friendly // Clean up the URI to be more fs-friendly
name := volumeId name := volumeID
name = strings.Replace(name, "://", "/", -1) name = strings.Replace(name, "://", "/", -1)
return path.Join(host.GetPluginDir(awsElasticBlockStorePluginName), "mounts", name) return path.Join(host.GetPluginDir(awsElasticBlockStorePluginName), "mounts", name)
} }
func getVolumeIdFromGlobalMount(host volume.VolumeHost, globalPath string) (string, error) { func getVolumeIDFromGlobalMount(host volume.VolumeHost, globalPath string) (string, error) {
basePath := path.Join(host.GetPluginDir(awsElasticBlockStorePluginName), "mounts") basePath := path.Join(host.GetPluginDir(awsElasticBlockStorePluginName), "mounts")
rel, err := filepath.Rel(basePath, globalPath) rel, err := filepath.Rel(basePath, globalPath)
if err != nil { if err != nil {
@ -249,12 +249,12 @@ func getVolumeIdFromGlobalMount(host volume.VolumeHost, globalPath string) (stri
return "", fmt.Errorf("Unexpected mount path: " + globalPath) return "", fmt.Errorf("Unexpected mount path: " + globalPath)
} }
// Reverse the :// replacement done in makeGlobalPDPath // Reverse the :// replacement done in makeGlobalPDPath
volumeId := rel volumeID := rel
if strings.HasPrefix(volumeId, "aws/") { if strings.HasPrefix(volumeID, "aws/") {
volumeId = strings.Replace(volumeId, "aws/", "aws://", 1) volumeID = strings.Replace(volumeID, "aws/", "aws://", 1)
} }
glog.V(2).Info("Mapping mount dir ", globalPath, " to volumeId ", volumeId) glog.V(2).Info("Mapping mount dir ", globalPath, " to volumeID ", volumeID)
return volumeId, nil return volumeID, nil
} }
func (pd *awsElasticBlockStore) GetPath() string { func (pd *awsElasticBlockStore) GetPath() string {
@ -294,14 +294,14 @@ func (pd *awsElasticBlockStore) TearDownAt(dir string) error {
// If len(refs) is 1, then all bind mounts have been removed, and the // If len(refs) is 1, then all bind mounts have been removed, and the
// 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.volumeId is not initially set for volume-cleaners, so set it here. // pd.volumeID is not initially set for volume-cleaners, so set it here.
pd.volumeId, err = getVolumeIdFromGlobalMount(pd.plugin.host, refs[0]) pd.volumeID, err = getVolumeIDFromGlobalMount(pd.plugin.host, refs[0])
if err != nil { if err != nil {
glog.V(2).Info("Could not determine volumeId from mountpoint ", refs[0], ": ", err) glog.V(2).Info("Could not determine volumeID from mountpoint ", refs[0], ": ", err)
return err return err
} }
if err := pd.manager.DetachDisk(pd); err != nil { if err := pd.manager.DetachDisk(pd); err != nil {
glog.V(2).Info("Error detaching disk ", pd.volumeId, ": ", err) glog.V(2).Info("Error detaching disk ", pd.volumeID, ": ", err)
return err return err
} }
} }

View File

@ -72,7 +72,7 @@ type fakePDManager struct{}
// TODO(jonesdl) To fully test this, we could create a loopback device // TODO(jonesdl) To fully test this, we could create a loopback device
// and mount that instead. // and mount that instead.
func (fake *fakePDManager) AttachAndMountDisk(pd *awsElasticBlockStore, globalPDPath string) error { func (fake *fakePDManager) AttachAndMountDisk(pd *awsElasticBlockStore, globalPDPath string) error {
globalPath := makeGlobalPDPath(pd.plugin.host, pd.volumeId) globalPath := makeGlobalPDPath(pd.plugin.host, pd.volumeID)
err := os.MkdirAll(globalPath, 0750) err := os.MkdirAll(globalPath, 0750)
if err != nil { if err != nil {
return err return err
@ -81,7 +81,7 @@ func (fake *fakePDManager) AttachAndMountDisk(pd *awsElasticBlockStore, globalPD
} }
func (fake *fakePDManager) DetachDisk(pd *awsElasticBlockStore) error { func (fake *fakePDManager) DetachDisk(pd *awsElasticBlockStore) error {
globalPath := makeGlobalPDPath(pd.plugin.host, pd.volumeId) globalPath := makeGlobalPDPath(pd.plugin.host, pd.volumeID)
err := os.RemoveAll(globalPath) err := os.RemoveAll(globalPath)
if err != nil { if err != nil {
return err return err
@ -101,7 +101,7 @@ func TestPlugin(t *testing.T) {
Name: "vol1", Name: "vol1",
VolumeSource: api.VolumeSource{ VolumeSource: api.VolumeSource{
AWSElasticBlockStore: &api.AWSElasticBlockStoreVolumeSource{ AWSElasticBlockStore: &api.AWSElasticBlockStoreVolumeSource{
VolumeId: "pd", VolumeID: "pd",
FSType: "ext4", FSType: "ext4",
}, },
}, },

View File

@ -40,7 +40,7 @@ func (util *AWSDiskUtil) AttachAndMountDisk(pd *awsElasticBlockStore, globalPDPa
if pd.readOnly { if pd.readOnly {
flags = mount.FlagReadOnly flags = mount.FlagReadOnly
} }
devicePath, err := volumes.AttachDisk("", pd.volumeId, pd.readOnly) devicePath, err := volumes.AttachDisk("", pd.volumeID, pd.readOnly)
if err != nil { if err != nil {
return err return err
} }
@ -89,7 +89,7 @@ func (util *AWSDiskUtil) AttachAndMountDisk(pd *awsElasticBlockStore, globalPDPa
// Unmounts the device and detaches the disk from the kubelet's host machine. // Unmounts the device and detaches the disk from the kubelet's host machine.
func (util *AWSDiskUtil) DetachDisk(pd *awsElasticBlockStore) error { func (util *AWSDiskUtil) DetachDisk(pd *awsElasticBlockStore) error {
// Unmount the global PD mount, which should be the only one. // Unmount the global PD mount, which should be the only one.
globalPDPath := makeGlobalPDPath(pd.plugin.host, pd.volumeId) globalPDPath := makeGlobalPDPath(pd.plugin.host, pd.volumeID)
if err := pd.mounter.Unmount(globalPDPath, 0); err != nil { if err := pd.mounter.Unmount(globalPDPath, 0); err != nil {
glog.V(2).Info("Error unmount dir ", globalPDPath, ": ", err) glog.V(2).Info("Error unmount dir ", globalPDPath, ": ", err)
return err return err
@ -101,11 +101,11 @@ func (util *AWSDiskUtil) DetachDisk(pd *awsElasticBlockStore) error {
// Detach the disk // Detach the disk
volumes, err := pd.getVolumeProvider() volumes, err := pd.getVolumeProvider()
if err != nil { if err != nil {
glog.V(2).Info("Error getting volume provider for volumeId ", pd.volumeId, ": ", err) glog.V(2).Info("Error getting volume provider for volumeID ", pd.volumeID, ": ", err)
return err return err
} }
if err := volumes.DetachDisk("", pd.volumeId); err != nil { if err := volumes.DetachDisk("", pd.volumeID); err != nil {
glog.V(2).Info("Error detaching disk ", pd.volumeId, ": ", err) glog.V(2).Info("Error detaching disk ", pd.volumeID, ": ", err)
return err return err
} }
return nil return nil

View File

@ -275,7 +275,7 @@ func testPDPod(diskName, targetHost string, readOnly bool) *api.Pod {
Name: "testpd", Name: "testpd",
VolumeSource: api.VolumeSource{ VolumeSource: api.VolumeSource{
AWSElasticBlockStore: &api.AWSElasticBlockStoreVolumeSource{ AWSElasticBlockStore: &api.AWSElasticBlockStoreVolumeSource{
VolumeId: diskName, VolumeID: diskName,
FSType: "ext4", FSType: "ext4",
ReadOnly: readOnly, ReadOnly: readOnly,
}, },