Skip to content

Commit

Permalink
fix: Ensure EbsOptimizedInfo exists when selecting by max bandwidth
Browse files Browse the repository at this point in the history
`g2.xlarge` has `.EbsInfo.EbsOptimizedSupport == "default"`, but no
`.EbsInfo.EbsOptimizedInfo`. When selecting instance by EBS maximum
bandwidth, make sure that this key exists.
  • Loading branch information
kanwren committed Aug 6, 2024
1 parent 0d86d47 commit 648033f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/providers/instancetype/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ func computeRequirements(info *ec2.InstanceTypeInfo, offerings cloudprovider.Off
requirements.Get(v1.LabelInstanceCPUManufacturer).Insert(lowerKabobCase(aws.StringValue(info.ProcessorInfo.Manufacturer)))
}
// EBS Max Bandwidth
if info.EbsInfo != nil && aws.StringValue(info.EbsInfo.EbsOptimizedSupport) == ec2.EbsOptimizedSupportDefault {
if info.EbsInfo != nil && info.EbsInfo.EbsOptimizedInfo != nil && aws.StringValue(info.EbsInfo.EbsOptimizedSupport) == ec2.EbsOptimizedSupportDefault {
requirements.Get(v1.LabelInstanceEBSBandwidth).Insert(fmt.Sprint(aws.Int64Value(info.EbsInfo.EbsOptimizedInfo.MaximumBandwidthInMbps)))
}
return requirements
Expand Down

0 comments on commit 648033f

Please sign in to comment.