Skip to content

Commit

Permalink
feat(docker): Enable cache fallback (#24110)
Browse files Browse the repository at this point in the history
  • Loading branch information
zharinov committed Aug 28, 2023
1 parent b71e4b0 commit 0578cdc
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions lib/modules/datasource/docker/index.ts
Expand Up @@ -861,6 +861,20 @@ export class DockerDatasource extends Datasource {
*
* This function will filter only tags that contain a semver version
*/
@cache({
namespace: 'datasource-docker-releases',
key: ({ registryUrl, packageName }: GetReleasesConfig) => {
const { registryHost, dockerRepository } = getRegistryRepository(
packageName,
registryUrl!
);
return `${registryHost}:${dockerRepository}`;
},
cacheable: ({ registryUrl, packageName }: GetReleasesConfig) => {
const { registryHost } = getRegistryRepository(packageName, registryUrl!);
return registryHost === 'https://index.docker.io';
},
})
async getReleases({
packageName,
registryUrl,
Expand Down

0 comments on commit 0578cdc

Please sign in to comment.