Skip to content

Commit

Permalink
fix(manager/helmfile): Detect more local charts (#21093)
Browse files Browse the repository at this point in the history
  • Loading branch information
nikolaik committed Mar 26, 2023
1 parent 5110d43 commit e368cde
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
6 changes: 6 additions & 0 deletions lib/modules/manager/helmfile/__fixtures__/go-template.yaml
Expand Up @@ -10,6 +10,12 @@ releases:
- name: "{{ requiredEnv \"RELEASE_NAME\" }}"
namespace: default
chart: ./foo
- name: "{{ requiredEnv \"RELEASE_NAME\" }}"
namespace: default
chart: ../bar
- name: "{{ requiredEnv \"RELEASE_NAME\" }}"
namespace: default
chart: /baz
- name: {{ requiredEnv "RELEASE_NAME" }}
namespace: default
chart: ./foo
Expand Down
8 changes: 8 additions & 0 deletions lib/modules/manager/helmfile/extract.spec.ts
Expand Up @@ -335,6 +335,14 @@ describe('modules/manager/helmfile/extract', () => {
expect(result).toMatchObject({
datasource: 'helm',
deps: [
{
depName: '',
skipReason: 'local-chart',
},
{
depName: '',
skipReason: 'local-chart',
},
{
depName: '',
skipReason: 'local-chart',
Expand Down
4 changes: 2 additions & 2 deletions lib/modules/manager/helmfile/extract.ts
Expand Up @@ -59,8 +59,8 @@ export function extractPackageFile(
};
}

// If starts with ./ is for sure a local path
if (dep.chart.startsWith('./')) {
// If it starts with ./ ../ or / then it's a local path
if (['./', '../', '/'].some((val) => dep.chart.startsWith(val))) {
return {
depName: dep.name,
skipReason: 'local-chart',
Expand Down

0 comments on commit e368cde

Please sign in to comment.