lib/kitchen/driver/oci/models/compute.rb in kitchen-oci-1.24.0 vs lib/kitchen/driver/oci/models/compute.rb in kitchen-oci-1.25.0

- old
+ new

@@ -65,17 +65,25 @@ image_id_by_name end def image_id_by_name - image_name = config[:image_name].gsub(" ", "-") + image_name = image_name_conversion image_list = images.select { |i| i.display_name.match(/#{image_name}/) } raise "unable to find image_id" if image_list.empty? image_list = filter_image_list(image_list, image_name) if image_list.count > 1 raise "unable to find image_id" if image_list.empty? latest_image_id(image_list) + end + + def image_name_conversion + image_name = config[:image_name].gsub(" ", "-") + if config[:shape] =~ /^VM\.Standard\.A\d+\.Flex$/ && !config[:image_name].include?("aarch64") + image_name = "#{image_name}-aarch64" + end + image_name end def filter_image_list(image_list, image_name) image_list.select { |i| i.display_name.match(/#{image_name}-[0-9]{4}\.[0-9]{2}\.[0-9]{2}/) } end