Skip to content

Commit

Permalink
Wire provider spec EBS volume Encrypted field into ec2.EbsBlockDevice…
Browse files Browse the repository at this point in the history
….Encrypted field

AWS actuator allows to specify encrypted root volumes for compute machines.
Though, it does not wire it to EBS definition which is passed to AWS ec2 service.
The provider should respect the setting and provision encrypted volumes when requested.

Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1734193
  • Loading branch information
ingvagabund committed Aug 5, 2019
1 parent 7a53d36 commit 99de8f2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/actuators/machine/instances.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ func getAMI(AMI providerconfigv1.AWSResourceReference, client awsclient.Client)
}

func getBlockDeviceMappings(blockDeviceMappings []providerconfigv1.BlockDeviceMappingSpec, AMI string, client awsclient.Client) ([]*ec2.BlockDeviceMapping, error) {
if len(blockDeviceMappings) == 0 {
if len(blockDeviceMappings) == 0 || blockDeviceMappings[0].EBS == nil {
return []*ec2.BlockDeviceMapping{}, nil
}

Expand All @@ -205,6 +205,7 @@ func getBlockDeviceMappings(blockDeviceMappings []providerconfigv1.BlockDeviceMa
Ebs: &ec2.EbsBlockDevice{
VolumeSize: volumeSize,
VolumeType: volumeType,
Encrypted: blockDeviceMappings[0].EBS.Encrypted,
},
}
if *volumeType == "io1" {
Expand Down

0 comments on commit 99de8f2

Please sign in to comment.