From cf72e8f5553837bb52e06a4fb337f82a7d255193 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nikolai=20R=C3=B8ed=20Kristiansen?= <nikolai.kristiansen@remarkable.no> Date: Mon, 6 Feb 2023 14:30:57 +0100 Subject: [PATCH] fix(manager/helmfile): Add missing helm dependency (#20227) Co-authored-by: Michael Kriese <michael.kriese@visualon.de> --- lib/modules/manager/helmfile/artifacts.spec.ts | 7 +++++++ lib/modules/manager/helmfile/artifacts.ts | 17 +++++++++++------ 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/lib/modules/manager/helmfile/artifacts.spec.ts b/lib/modules/manager/helmfile/artifacts.spec.ts index bafac29a11..9c699bcfbb 100644 --- a/lib/modules/manager/helmfile/artifacts.spec.ts +++ b/lib/modules/manager/helmfile/artifacts.spec.ts @@ -167,6 +167,8 @@ describe('modules/manager/helmfile/artifacts', () => { '-w "/tmp/github/some/repo" ' + 'renovate/sidecar ' + 'bash -l -c "' + + 'install-tool helm v3.7.2' + + ' && ' + 'install-tool helmfile v0.129.0' + ' && ' + 'helmfile deps -f helmfile.yaml' + @@ -177,6 +179,7 @@ describe('modules/manager/helmfile/artifacts', () => { { binarySource: 'install', expectedCommands: [ + { cmd: 'install-tool helm v3.7.2' }, { cmd: 'install-tool helmfile v0.129.0' }, { cmd: 'helmfile deps -f helmfile.yaml' }, ], @@ -193,6 +196,10 @@ describe('modules/manager/helmfile/artifacts', () => { '/tmp/renovate/cache/__renovate-private-cache' ); fs.getParentDir.mockReturnValue(''); + // helm + datasource.getPkgReleases.mockResolvedValueOnce({ + releases: [{ version: 'v3.7.2' }], + }); datasource.getPkgReleases.mockResolvedValueOnce({ releases: [{ version: 'v0.129.0' }], }); diff --git a/lib/modules/manager/helmfile/artifacts.ts b/lib/modules/manager/helmfile/artifacts.ts index 458f78c3e6..c7a9f23ae5 100644 --- a/lib/modules/manager/helmfile/artifacts.ts +++ b/lib/modules/manager/helmfile/artifacts.ts @@ -3,7 +3,7 @@ import { quote } from 'shlex'; import { TEMPORARY_ERROR } from '../../../constants/error-messages'; import { logger } from '../../../logger'; import { exec } from '../../../util/exec'; -import type { ExecOptions, ToolConstraint } from '../../../util/exec/types'; +import type { ExecOptions } from '../../../util/exec/types'; import { getSiblingFileName, readLocalFile, @@ -39,15 +39,20 @@ export async function updateArtifacts({ try { await writeLocalFile(packageFileName, newPackageFileContent); - const helmfileToolConstraint: ToolConstraint = { - toolName: 'helmfile', - constraint: config.constraints?.helmfile, - }; const execOptions: ExecOptions = { docker: {}, extraEnv: {}, - toolConstraints: [helmfileToolConstraint], + toolConstraints: [ + { + toolName: 'helm', + constraint: config.constraints?.helm, + }, + { + toolName: 'helmfile', + constraint: config.constraints?.helmfile, + }, + ], }; await exec(`helmfile deps -f ${quote(packageFileName)}`, execOptions); -- GitLab