diff --git a/lib/modules/manager/flux/extract.spec.ts b/lib/modules/manager/flux/extract.spec.ts index f8706f114625a4..134fc4dd6ed73e 100644 --- a/lib/modules/manager/flux/extract.spec.ts +++ b/lib/modules/manager/flux/extract.spec.ts @@ -171,6 +171,34 @@ describe('modules/manager/flux/extract', () => { expect(result).toBeNull(); }); + it('skip HelmRelease with local chart', () => { + const result = extractPackageFile( + codeBlock` + apiVersion: helm.toolkit.fluxcd.io/v2beta1 + kind: HelmRelease + metadata: + name: cert-manager-config + namespace: kube-system + spec: + chart: + spec: + chart: ./charts/cert-manager-config + sourceRef: + kind: GitRepository + name: chart-repo + `, + 'test.yaml', + ); + expect(result).toEqual({ + deps: [ + { + depName: './charts/cert-manager-config', + skipReason: 'local-chart', + }, + ], + }); + }); + it('does not match HelmRelease resources without a namespace to HelmRepository resources without a namespace', () => { const result = extractPackageFile( codeBlock` diff --git a/lib/modules/manager/flux/extract.ts b/lib/modules/manager/flux/extract.ts index c6c57a4ee8021f..a592183c303b69 100644 --- a/lib/modules/manager/flux/extract.ts +++ b/lib/modules/manager/flux/extract.ts @@ -126,12 +126,20 @@ function resolveResourceManifest( for (const resource of manifest.resources) { switch (resource.kind) { case 'HelmRelease': { + const depName = resource.spec.chart.spec.chart; const dep: PackageDependency = { - depName: resource.spec.chart.spec.chart, + depName, currentValue: resource.spec.chart.spec.version, datasource: HelmDatasource.id, }; + if (depName.startsWith('./')) { + dep.skipReason = 'local-chart'; + delete dep.datasource; + deps.push(dep); + continue; + } + const matchingRepositories = helmRepositories.filter( (rep) => rep.kind === resource.spec.chart.spec.sourceRef?.kind &&