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