diff --git a/README.md b/README.md index bd6d9f68..135e768b 100644 --- a/README.md +++ b/README.md @@ -59,7 +59,7 @@ In order to use this new functionality, run: `$: bundle exec matrix_from_metadata_v2 --custom-matrix matrix.json` -> Note: The file should contain a valid Array of JSON Objects (i.e. `[{"label":"AlmaLinux-8","provider":"provision_service","image":"almalinux-cloud/almalinux-8"}, {..}]`), otherwise it will throw an error. +> Note: The file should contain a valid Array of JSON Objects (i.e. `[{"label":"AlmaLinux-8","provider":"provision_service","image":"almalinux-cloud/almalinux-8", "machine_type":"n1-standard-2"}, {..}]`), otherwise it will throw an error. ## Documentation diff --git a/exe/matrix_from_metadata_v2 b/exe/matrix_from_metadata_v2 index 44d8b552..67ea0dcf 100755 --- a/exe/matrix_from_metadata_v2 +++ b/exe/matrix_from_metadata_v2 @@ -157,7 +157,9 @@ else matrix[:platforms] << { label: image_key, provider: 'provision_service', - image: IMAGE_TABLE[image_key] + image: IMAGE_TABLE[image_key], + # if the image is to be an ARM based instance, use t2a-standard-2 machine type + machine_type: image_key.end_with?('-arm') ? 't2a-standard-2' : 'n1-standard-2' } elsif DOCKER_PLATFORMS.key?(image_key) && !exclude_list.include?(image_key.downcase) matrix[:platforms] << { diff --git a/spec/exe/matrix_from_metadata_v2_spec.rb b/spec/exe/matrix_from_metadata_v2_spec.rb index 849355d5..0c24956f 100644 --- a/spec/exe/matrix_from_metadata_v2_spec.rb +++ b/spec/exe/matrix_from_metadata_v2_spec.rb @@ -23,8 +23,8 @@ 'matrix={', '"platforms":[', '{"label":"CentOS-6","provider":"docker","image":"litmusimage/centos:6"},', - '{"label":"RedHat-8","provider":"provision_service","image":"rhel-8"},', - '{"label":"RedHat-9-arm","provider":"provision_service","image":"rhel-9-arm64"},', + '{"label":"RedHat-8","provider":"provision_service","image":"rhel-8","machine_type":"n1-standard-2"},', + '{"label":"RedHat-9-arm","provider":"provision_service","image":"rhel-9-arm64","machine_type":"t2a-standard-2"},', '{"label":"Ubuntu-18.04","provider":"docker","image":"litmusimage/ubuntu:18.04"}', '],', '"collection":[', @@ -61,8 +61,8 @@ 'matrix={', '"platforms":[', '{"label":"CentOS-6","provider":"docker","image":"litmusimage/centos:6"},', - '{"label":"RedHat-8","provider":"provision_service","image":"rhel-8"},', - '{"label":"RedHat-9-arm","provider":"provision_service","image":"rhel-9-arm64"}', + '{"label":"RedHat-8","provider":"provision_service","image":"rhel-8","machine_type":"n1-standard-2"},', + '{"label":"RedHat-9-arm","provider":"provision_service","image":"rhel-9-arm64","machine_type":"t2a-standard-2"}', '],', '"collection":[', '"puppet7-nightly","puppet8-nightly"', @@ -99,7 +99,7 @@ 'matrix={', '"platforms":[', '{"label":"CentOS-6","provider":"docker","image":"litmusimage/centos:6"},', - '{"label":"RedHat-9-arm","provider":"provision_service","image":"rhel-9-arm64"}', + '{"label":"RedHat-9-arm","provider":"provision_service","image":"rhel-9-arm64","machine_type":"t2a-standard-2"}', '],', '"collection":[', '"puppet7-nightly","puppet8-nightly"',