Skip to content

Commit

Permalink
Merge branch 'main' into allow_conan_ref_with_user_only
Browse files Browse the repository at this point in the history
  • Loading branch information
dazze1812 authored Jan 8, 2024
2 parents 494b0c9 + 5f24ab9 commit 136e560
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 52 deletions.
14 changes: 9 additions & 5 deletions lib/modules/datasource/docker/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ export class DockerDatasource extends Datasource {
) => `${registryHost}:${dockerRepository}@${configDigest}`,
ttlMinutes: 1440 * 28,
})
public async getImageConfig(
async getImageConfig(
registryHost: string,
dockerRepository: string,
configDigest: string,
Expand Down Expand Up @@ -221,7 +221,7 @@ export class DockerDatasource extends Datasource {
) => `${registryHost}:${dockerRepository}@${configDigest}`,
ttlMinutes: 1440 * 28,
})
public async getHelmConfig(
async getHelmConfig(
registryHost: string,
dockerRepository: string,
configDigest: string,
Expand Down Expand Up @@ -336,7 +336,7 @@ export class DockerDatasource extends Datasource {
) => `${registryHost}:${dockerRepository}@${currentDigest}`,
ttlMinutes: 1440 * 28,
})
public async getImageArchitecture(
async getImageArchitecture(
registryHost: string,
dockerRepository: string,
currentDigest: string,
Expand Down Expand Up @@ -434,7 +434,7 @@ export class DockerDatasource extends Datasource {
`${registryHost}:${dockerRepository}:${tag}`,
ttlMinutes: 24 * 60,
})
public async getLabels(
async getLabels(
registryHost: string,
dockerRepository: string,
tag: string,
Expand Down Expand Up @@ -687,7 +687,7 @@ export class DockerDatasource extends Datasource {
key: (registryHost: string, dockerRepository: string) =>
`${registryHost}:${dockerRepository}`,
})
public async getTags(
async getTags(
registryHost: string,
dockerRepository: string,
): Promise<string[] | null> {
Expand Down Expand Up @@ -913,6 +913,10 @@ export class DockerDatasource extends Datasource {
return digest;
}

@cache({
namespace: 'datasource-docker-hub-tags',
key: (dockerRepository: string) => `${dockerRepository}`,
})
async getDockerHubTags(dockerRepository: string): Promise<Release[] | null> {
const result: Release[] = [];
let url: null | string =
Expand Down
30 changes: 15 additions & 15 deletions lib/modules/manager/helmv3/__snapshots__/artifacts.spec.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
exports[`modules/manager/helmv3/artifacts alias name is picked, when repository is as alias and dependency defined 1`] = `
[
{
"cmd": "helm repo add repo1 https://gitlab.com/api/v4/projects/xxxxxxx/packages/helm/stable --username basicUser --password secret",
"cmd": "helm repo add repo1 https://gitlab.com/api/v4/projects/xxxxxxx/packages/helm/stable --force-update --username basicUser --password secret",
"options": {
"cwd": "/tmp/github/some/repo",
"encoding": "utf-8",
Expand Down Expand Up @@ -52,7 +52,7 @@ exports[`modules/manager/helmv3/artifacts alias name is picked, when repository
exports[`modules/manager/helmv3/artifacts do not add registryAliases to repository list 1`] = `
[
{
"cmd": "helm repo add jetstack https://charts.jetstack.io",
"cmd": "helm repo add jetstack https://charts.jetstack.io --force-update",
"options": {
"cwd": "/tmp/github/some/repo",
"encoding": "utf-8",
Expand All @@ -74,7 +74,7 @@ exports[`modules/manager/helmv3/artifacts do not add registryAliases to reposito
},
},
{
"cmd": "helm repo add nginx https://kubernetes.github.io/ingress-nginx",
"cmd": "helm repo add nginx https://kubernetes.github.io/ingress-nginx --force-update",
"options": {
"cwd": "/tmp/github/some/repo",
"encoding": "utf-8",
Expand Down Expand Up @@ -145,7 +145,7 @@ exports[`modules/manager/helmv3/artifacts log into private registries and reposi
},
},
{
"cmd": "helm repo add repo-test https://gitlab.com/api/v4/projects/xxxxxxx/packages/helm/stable --username basicUser --password secret",
"cmd": "helm repo add repo-test https://gitlab.com/api/v4/projects/xxxxxxx/packages/helm/stable --force-update --username basicUser --password secret",
"options": {
"cwd": "/tmp/github/some/repo",
"encoding": "utf-8",
Expand Down Expand Up @@ -216,7 +216,7 @@ exports[`modules/manager/helmv3/artifacts log into private registries and reposi
},
},
{
"cmd": "helm repo add stable the_stable_url",
"cmd": "helm repo add stable the_stable_url --force-update",
"options": {
"cwd": "/tmp/github/some/repo",
"encoding": "utf-8",
Expand All @@ -238,7 +238,7 @@ exports[`modules/manager/helmv3/artifacts log into private registries and reposi
},
},
{
"cmd": "helm repo add repo1 https://the_repo1_url --username basicUser --password secret",
"cmd": "helm repo add repo1 https://the_repo1_url --force-update --username basicUser --password secret",
"options": {
"cwd": "/tmp/github/some/repo",
"encoding": "utf-8",
Expand All @@ -260,7 +260,7 @@ exports[`modules/manager/helmv3/artifacts log into private registries and reposi
},
},
{
"cmd": "helm repo add repo-test https://gitlab.com/api/v4/projects/xxxxxxx/packages/helm/stable",
"cmd": "helm repo add repo-test https://gitlab.com/api/v4/projects/xxxxxxx/packages/helm/stable --force-update",
"options": {
"cwd": "/tmp/github/some/repo",
"encoding": "utf-8",
Expand Down Expand Up @@ -309,7 +309,7 @@ exports[`modules/manager/helmv3/artifacts log into private registries and reposi
exports[`modules/manager/helmv3/artifacts returns null if unchanged 1`] = `
[
{
"cmd": "helm repo add repo-test https://gitlab.com/api/v4/projects/xxxxxxx/packages/helm/stable",
"cmd": "helm repo add repo-test https://gitlab.com/api/v4/projects/xxxxxxx/packages/helm/stable --force-update",
"options": {
"cwd": "/tmp/github/some/repo",
"encoding": "utf-8",
Expand Down Expand Up @@ -358,7 +358,7 @@ exports[`modules/manager/helmv3/artifacts returns null if unchanged 1`] = `
exports[`modules/manager/helmv3/artifacts returns updated Chart.lock 1`] = `
[
{
"cmd": "helm repo add repo-test https://gitlab.com/api/v4/projects/xxxxxxx/packages/helm/stable",
"cmd": "helm repo add repo-test https://gitlab.com/api/v4/projects/xxxxxxx/packages/helm/stable --force-update",
"options": {
"cwd": "/tmp/github/some/repo",
"encoding": "utf-8",
Expand Down Expand Up @@ -407,7 +407,7 @@ exports[`modules/manager/helmv3/artifacts returns updated Chart.lock 1`] = `
exports[`modules/manager/helmv3/artifacts returns updated Chart.lock for lockfile maintenance 1`] = `
[
{
"cmd": "helm repo add repo-test https://gitlab.com/api/v4/projects/xxxxxxx/packages/helm/stable",
"cmd": "helm repo add repo-test https://gitlab.com/api/v4/projects/xxxxxxx/packages/helm/stable --force-update",
"options": {
"cwd": "/tmp/github/some/repo",
"encoding": "utf-8",
Expand Down Expand Up @@ -468,7 +468,7 @@ exports[`modules/manager/helmv3/artifacts returns updated Chart.lock with docker
},
},
{
"cmd": "docker run --rm --name=renovate_sidecar --label=renovate_child -v "/tmp/github/some/repo":"/tmp/github/some/repo" -v "/tmp/renovate/cache":"/tmp/renovate/cache" -e HELM_EXPERIMENTAL_OCI -e HELM_REGISTRY_CONFIG -e HELM_REPOSITORY_CONFIG -e HELM_REPOSITORY_CACHE -e CONTAINERBASE_CACHE_DIR -w "/tmp/github/some/repo" ghcr.io/containerbase/sidecar bash -l -c "install-tool helm v3.7.2 && helm repo add repo-test https://gitlab.com/api/v4/projects/xxxxxxx/packages/helm/stable && helm dependency update ''"",
"cmd": "docker run --rm --name=renovate_sidecar --label=renovate_child -v "/tmp/github/some/repo":"/tmp/github/some/repo" -v "/tmp/renovate/cache":"/tmp/renovate/cache" -e HELM_EXPERIMENTAL_OCI -e HELM_REGISTRY_CONFIG -e HELM_REPOSITORY_CONFIG -e HELM_REPOSITORY_CACHE -e CONTAINERBASE_CACHE_DIR -w "/tmp/github/some/repo" ghcr.io/containerbase/sidecar bash -l -c "install-tool helm v3.7.2 && helm repo add repo-test https://gitlab.com/api/v4/projects/xxxxxxx/packages/helm/stable --force-update && helm dependency update ''"",
"options": {
"cwd": "/tmp/github/some/repo",
"encoding": "utf-8",
Expand Down Expand Up @@ -496,7 +496,7 @@ exports[`modules/manager/helmv3/artifacts returns updated Chart.lock with docker
exports[`modules/manager/helmv3/artifacts sets repositories from registryAliases 1`] = `
[
{
"cmd": "helm repo add stable the_stable_url",
"cmd": "helm repo add stable the_stable_url --force-update",
"options": {
"cwd": "/tmp/github/some/repo",
"encoding": "utf-8",
Expand All @@ -518,7 +518,7 @@ exports[`modules/manager/helmv3/artifacts sets repositories from registryAliases
},
},
{
"cmd": "helm repo add repo1 the_repo1_url",
"cmd": "helm repo add repo1 the_repo1_url --force-update",
"options": {
"cwd": "/tmp/github/some/repo",
"encoding": "utf-8",
Expand All @@ -540,7 +540,7 @@ exports[`modules/manager/helmv3/artifacts sets repositories from registryAliases
},
},
{
"cmd": "helm repo add repo-test https://gitlab.com/api/v4/projects/xxxxxxx/packages/helm/stable",
"cmd": "helm repo add repo-test https://gitlab.com/api/v4/projects/xxxxxxx/packages/helm/stable --force-update",
"options": {
"cwd": "/tmp/github/some/repo",
"encoding": "utf-8",
Expand Down Expand Up @@ -601,7 +601,7 @@ exports[`modules/manager/helmv3/artifacts sets repositories from registryAliases
},
},
{
"cmd": "docker run --rm --name=renovate_sidecar --label=renovate_child -v "/tmp/github/some/repo":"/tmp/github/some/repo" -v "/tmp/renovate/cache":"/tmp/renovate/cache" -e HELM_EXPERIMENTAL_OCI -e HELM_REGISTRY_CONFIG -e HELM_REPOSITORY_CONFIG -e HELM_REPOSITORY_CACHE -e CONTAINERBASE_CACHE_DIR -w "/tmp/github/some/repo" ghcr.io/containerbase/sidecar bash -l -c "install-tool helm v3.7.2 && helm repo add stable the_stable_url && helm repo add repo1 the_repo1_url && helm repo add repo-test https://gitlab.com/api/v4/projects/xxxxxxx/packages/helm/stable && helm dependency update ''"",
"cmd": "docker run --rm --name=renovate_sidecar --label=renovate_child -v "/tmp/github/some/repo":"/tmp/github/some/repo" -v "/tmp/renovate/cache":"/tmp/renovate/cache" -e HELM_EXPERIMENTAL_OCI -e HELM_REGISTRY_CONFIG -e HELM_REPOSITORY_CONFIG -e HELM_REPOSITORY_CACHE -e CONTAINERBASE_CACHE_DIR -w "/tmp/github/some/repo" ghcr.io/containerbase/sidecar bash -l -c "install-tool helm v3.7.2 && helm repo add stable the_stable_url --force-update && helm repo add repo1 the_repo1_url --force-update && helm repo add repo-test https://gitlab.com/api/v4/projects/xxxxxxx/packages/helm/stable --force-update && helm dependency update ''"",
"options": {
"cwd": "/tmp/github/some/repo",
"encoding": "utf-8",
Expand Down
10 changes: 5 additions & 5 deletions lib/modules/manager/helmv3/artifacts.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ describe('modules/manager/helmv3/artifacts', () => {
]);
expect(execSnapshots).toMatchObject([
{
cmd: 'helm repo add repo-test https://gitlab.com/api/v4/projects/xxxxxxx/packages/helm/stable',
cmd: 'helm repo add repo-test https://gitlab.com/api/v4/projects/xxxxxxx/packages/helm/stable --force-update',
},
{
cmd: "helm dependency update ''",
Expand Down Expand Up @@ -343,7 +343,7 @@ describe('modules/manager/helmv3/artifacts', () => {
]);
expect(execSnapshots).toMatchObject([
{
cmd: 'helm repo add repo-test https://gitlab.com/api/v4/projects/xxxxxxx/packages/helm/stable',
cmd: 'helm repo add repo-test https://gitlab.com/api/v4/projects/xxxxxxx/packages/helm/stable --force-update',
options: {
env: {
HELM_EXPERIMENTAL_OCI: '1',
Expand Down Expand Up @@ -411,7 +411,7 @@ describe('modules/manager/helmv3/artifacts', () => {
]);
expect(execSnapshots).toMatchObject([
{
cmd: 'helm repo add repo-test https://gitlab.com/api/v4/projects/xxxxxxx/packages/helm/stable',
cmd: 'helm repo add repo-test https://gitlab.com/api/v4/projects/xxxxxxx/packages/helm/stable --force-update',
options: {
env: {
HELM_EXPERIMENTAL_OCI: '1',
Expand Down Expand Up @@ -486,7 +486,7 @@ describe('modules/manager/helmv3/artifacts', () => {
]);
expect(execSnapshots).toMatchObject([
{
cmd: 'helm repo add repo-test https://gitlab.com/api/v4/projects/xxxxxxx/packages/helm/stable',
cmd: 'helm repo add repo-test https://gitlab.com/api/v4/projects/xxxxxxx/packages/helm/stable --force-update',
options: {
env: {
HELM_EXPERIMENTAL_OCI: '1',
Expand Down Expand Up @@ -546,7 +546,7 @@ describe('modules/manager/helmv3/artifacts', () => {
).toBeNull();
expect(execSnapshots).toMatchObject([
{
cmd: 'helm repo add repo-test https://gitlab.com/api/v4/projects/xxxxxxx/packages/helm/stable',
cmd: 'helm repo add repo-test https://gitlab.com/api/v4/projects/xxxxxxx/packages/helm/stable --force-update',
options: {
env: {
HELM_EXPERIMENTAL_OCI: '1',
Expand Down
2 changes: 1 addition & 1 deletion lib/modules/manager/helmv3/artifacts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ async function helmCommands(
// add helm repos if an alias or credentials for the url are defined
classicRepositories.forEach((value) => {
const { username, password } = value.hostRule;
const parameters = [`${value.repository}`];
const parameters = [`${value.repository}`, `--force-update`];
const isPrivateRepo = username && password;
if (isPrivateRepo) {
parameters.push(`--username ${quote(username)}`);
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@
"@types/xmldoc": "1.1.9",
"@typescript-eslint/eslint-plugin": "6.16.0",
"@typescript-eslint/parser": "6.16.0",
"aws-sdk-client-mock": "3.0.0",
"aws-sdk-client-mock": "3.0.1",
"callsite": "1.0.0",
"common-tags": "1.8.2",
"conventional-changelog-conventionalcommits": "7.0.2",
Expand Down
37 changes: 12 additions & 25 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 136e560

Please sign in to comment.