mirror of
https://github.com/zalando/postgres-operator.git
synced 2026-09-30 14:22:47 +02:00
Full AWS gp3 support for iops and througput config. (#1261)
Support new AWS EBS volume type `gp3` with `iops` and `throughput` in the manifest. Co-authored-by: Felix Kunde <felix-kunde@gmx.de>
This commit is contained in:
co-authored by
Felix Kunde
parent
4ea0b5f432
commit
4a88f00a3f
+2
-11
@@ -141,18 +141,9 @@ 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 {
|
||||
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}
|
||||
input := ec2.ModifyVolumeInput{Size: newSize, VolumeId: &volumeID, VolumeType: newType, Iops: iops, Throughput: throughput}
|
||||
output, err := r.connection.ModifyVolume(&input)
|
||||
if err != nil {
|
||||
return fmt.Errorf("could not modify persistent volume: %v", err)
|
||||
|
||||
@@ -21,7 +21,7 @@ type VolumeResizer interface {
|
||||
GetProviderVolumeID(pv *v1.PersistentVolume) (string, error)
|
||||
ExtractVolumeID(volumeID string) (string, error)
|
||||
ResizeVolume(providerVolumeID string, newSize int64) error
|
||||
ModifyVolume(providerVolumeID string, newType string, newSize int64, iops int64, throughput int64) error
|
||||
ModifyVolume(providerVolumeID string, newType *string, newSize *int64, iops *int64, throughput *int64) error
|
||||
DisconnectFromProvider() error
|
||||
DescribeVolumes(providerVolumesID []string) ([]VolumeProperties, error)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user