mirror of
https://github.com/renovatebot/renovate.git
synced 2025-01-12 06:56:24 +00:00
fix(datasource/docker): add cache decorator to getDockerHubTags
(#26546)
This commit is contained in:
parent
085ef7c038
commit
b33d09cbc7
1 changed files with 9 additions and 5 deletions
|
@ -176,7 +176,7 @@ export class DockerDatasource extends Datasource {
|
||||||
) => `${registryHost}:${dockerRepository}@${configDigest}`,
|
) => `${registryHost}:${dockerRepository}@${configDigest}`,
|
||||||
ttlMinutes: 1440 * 28,
|
ttlMinutes: 1440 * 28,
|
||||||
})
|
})
|
||||||
public async getImageConfig(
|
async getImageConfig(
|
||||||
registryHost: string,
|
registryHost: string,
|
||||||
dockerRepository: string,
|
dockerRepository: string,
|
||||||
configDigest: string,
|
configDigest: string,
|
||||||
|
@ -221,7 +221,7 @@ export class DockerDatasource extends Datasource {
|
||||||
) => `${registryHost}:${dockerRepository}@${configDigest}`,
|
) => `${registryHost}:${dockerRepository}@${configDigest}`,
|
||||||
ttlMinutes: 1440 * 28,
|
ttlMinutes: 1440 * 28,
|
||||||
})
|
})
|
||||||
public async getHelmConfig(
|
async getHelmConfig(
|
||||||
registryHost: string,
|
registryHost: string,
|
||||||
dockerRepository: string,
|
dockerRepository: string,
|
||||||
configDigest: string,
|
configDigest: string,
|
||||||
|
@ -336,7 +336,7 @@ export class DockerDatasource extends Datasource {
|
||||||
) => `${registryHost}:${dockerRepository}@${currentDigest}`,
|
) => `${registryHost}:${dockerRepository}@${currentDigest}`,
|
||||||
ttlMinutes: 1440 * 28,
|
ttlMinutes: 1440 * 28,
|
||||||
})
|
})
|
||||||
public async getImageArchitecture(
|
async getImageArchitecture(
|
||||||
registryHost: string,
|
registryHost: string,
|
||||||
dockerRepository: string,
|
dockerRepository: string,
|
||||||
currentDigest: string,
|
currentDigest: string,
|
||||||
|
@ -434,7 +434,7 @@ export class DockerDatasource extends Datasource {
|
||||||
`${registryHost}:${dockerRepository}:${tag}`,
|
`${registryHost}:${dockerRepository}:${tag}`,
|
||||||
ttlMinutes: 24 * 60,
|
ttlMinutes: 24 * 60,
|
||||||
})
|
})
|
||||||
public async getLabels(
|
async getLabels(
|
||||||
registryHost: string,
|
registryHost: string,
|
||||||
dockerRepository: string,
|
dockerRepository: string,
|
||||||
tag: string,
|
tag: string,
|
||||||
|
@ -687,7 +687,7 @@ export class DockerDatasource extends Datasource {
|
||||||
key: (registryHost: string, dockerRepository: string) =>
|
key: (registryHost: string, dockerRepository: string) =>
|
||||||
`${registryHost}:${dockerRepository}`,
|
`${registryHost}:${dockerRepository}`,
|
||||||
})
|
})
|
||||||
public async getTags(
|
async getTags(
|
||||||
registryHost: string,
|
registryHost: string,
|
||||||
dockerRepository: string,
|
dockerRepository: string,
|
||||||
): Promise<string[] | null> {
|
): Promise<string[] | null> {
|
||||||
|
@ -913,6 +913,10 @@ export class DockerDatasource extends Datasource {
|
||||||
return digest;
|
return digest;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@cache({
|
||||||
|
namespace: 'datasource-docker-hub-tags',
|
||||||
|
key: (dockerRepository: string) => `${dockerRepository}`,
|
||||||
|
})
|
||||||
async getDockerHubTags(dockerRepository: string): Promise<Release[] | null> {
|
async getDockerHubTags(dockerRepository: string): Promise<Release[] | null> {
|
||||||
const result: Release[] = [];
|
const result: Release[] = [];
|
||||||
let url: null | string =
|
let url: null | string =
|
||||||
|
|
Loading…
Reference in a new issue