@@ -241,14 +241,17 @@ def generate_os_matrix_dict(os_name: str, supported_operating_systems: list[str]
241241 return os_formatted_list
242242
243243
244- def generate_linux_instance_type_os_matrix (os_name : str , preferences : list [str ]) -> list [dict [str , dict [str , Any ]]]:
244+ def generate_linux_instance_type_os_matrix (
245+ os_name : str , preferences : list [str ], arch_suffix : str | None = None
246+ ) -> list [dict [str , dict [str , Any ]]]:
245247 """
246248 Generate a list of dictionaries representing the instance type matrix for a Linux OS type.
247249 Each dictionary represents a specific instance type and its configuration.
248250
249251 Args:
250252 os_name (str): The name of the OS.
251253 preferences (list[str]): A list of preferences for the instance types. Preference format is "<os>.<version>".
254+ arch_suffix: Optional architecture suffix. Example: "s390x", "arm64" . Omit to keep original preference.
252255
253256 Returns:
254257 list[dict[str, dict[str, Any]]]: A list of dictionaries representing the instance type matrix.
@@ -269,13 +272,14 @@ def _format_data_source_name(preference_name: str) -> str:
269272 instance_types : list [dict [str , dict [str , Any ]]] = []
270273
271274 for preference in preferences :
275+ arch_preference = f"{ preference } .{ arch_suffix } " if arch_suffix else preference
272276 preference_config : dict [str , Any ] = {
273- PREFERENCE_STR : preference ,
277+ PREFERENCE_STR : arch_preference ,
274278 DATA_SOURCE_NAME : _format_data_source_name (preference_name = preference ),
275279 }
276280
277281 if preference == latest_os :
278282 preference_config [LATEST_RELEASE_STR ] = True
279283
280- instance_types .append ({preference : preference_config })
284+ instance_types .append ({arch_preference : preference_config })
281285 return instance_types
0 commit comments