Files
ubicloud/lib/validation.rb
Maciek Sarnowicz a40eabb3de Prevent showing Burstable family for locations where it is not allowed
We got NoMethodError when viewing VM create page with burstables and location_latitude_fra feature flags enabled. This issue occurred because there is no billing rate for a burstable size for the latitude_fra location.

Add a BillingRate.unit_price_from_resource_properties that returns nil instead of raising a NoMethodError if there is no matching resource property. Use it to DRY up code in ContentGenerator::{Vm,Postgres}.

Make helpers/Vm#family and Postgres#family not return an a Burstable option if there are no valid billing_rate at the requested location for the family.
Also added a check for presence of billing rate for Nexus.assemble and PostgresResource.assemble, as a back-stop.
2025-03-03 09:02:53 -08:00

13 KiB