docker/install: Handle missing v prefix when searching GH release

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
This commit is contained in:
Paweł Gronowski 2024-09-09 14:43:37 +02:00
parent 10424facaf
commit b8a96071a8
No known key found for this signature in database
GPG Key ID: B85EFCFE26DEF92A

View File

@ -594,8 +594,11 @@ EOF`,
} }
const releases = <Record<string, GitHubRelease>>JSON.parse(body); const releases = <Record<string, GitHubRelease>>JSON.parse(body);
if (!releases[version]) { if (!releases[version]) {
if (!releases['v' + version]) {
throw new Error(`Cannot find Docker release ${version} in ${url}`); throw new Error(`Cannot find Docker release ${version} in ${url}`);
} }
return releases['v' + version];
}
return releases[version]; return releases[version];
} }