Remove unnecessary check. Fix test with pointers.

This commit is contained in:
Jan Mußler
2021-01-20 14:04:43 +01:00
parent bff8b09c42
commit 8ad58940bd
2 changed files with 2 additions and 10 deletions
-9
View File
@@ -143,15 +143,6 @@ func (r *EBSVolumeResizer) ResizeVolume(volumeID string, newSize int64) error {
// ModifyVolume Modify EBS volume
func (r *EBSVolumeResizer) ModifyVolume(volumeID string, newType *string, newSize *int64, iops *int64, throughput *int64) error {
/* first check if the volume is already of a requested size */
volumeOutput, err := r.connection.DescribeVolumes(&ec2.DescribeVolumesInput{VolumeIds: []*string{&volumeID}})
if err != nil {
return fmt.Errorf("could not get information about the volume: %v", err)
}
vol := volumeOutput.Volumes[0]
if *vol.VolumeId != volumeID {
return fmt.Errorf("describe volume %q returned information about a non-matching volume %q", volumeID, *vol.VolumeId)
}
input := ec2.ModifyVolumeInput{Size: newSize, VolumeId: &volumeID, VolumeType: newType, Iops: iops, Throughput: throughput}
output, err := r.connection.ModifyVolume(&input)
if err != nil {