Do not return the wrong version from get_default_runner_version_info() if a specific version is specified; this leads to crashes when we try to install a verison already installed.

This commit is contained in:
Daniel Johnson 2024-03-26 17:40:03 -04:00
parent cda7ce8871
commit ef5436edef

View file

@ -297,7 +297,10 @@ def get_default_runner_version_info(runner_name: str, version: Optional[str] = N
for candidate in iter_get_from_api_candidates():
if candidate:
return candidate
if not version:
return candidate
if version == candidate.get("version") and arch == candidate.get("architecture"):
return candidate
return None
return get_from_cache() or get_from_api()