Skip to content

Commit

Permalink
fix(manager/helmfile): replace escaped templates (#17513)
Browse files Browse the repository at this point in the history
  • Loading branch information
viceice committed Aug 31, 2022
1 parent 7c05653 commit adc056c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 5 additions & 1 deletion lib/modules/manager/helmfile/__fixtures__/multidoc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ releases:

- name: "external-dns"
chart: "bitnami/external-dns"
namespace: "external-dns"
namespace: {{`"{{request.object.metadata.name}}"`}}
version: {{ .Values | getOrNil "external_dns.version" | default "4.5.5" }}
installed: {{ .Values | getOrNil "external_dns.installed" | default false }}
text: |-
{{`{{ range .Alerts }}
*Alert:* {{ .Annotations.summary }}
{{ end }}`}}
4 changes: 3 additions & 1 deletion lib/modules/manager/helmfile/extract.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ const isValidChartName = (name: string | undefined): boolean =>

function extractYaml(content: string): string {
// regex remove go templated ({{ . }}) values
return content.replace(regEx(/{{.+?}}/g), '');
return content
.replace(regEx(/{{`.+?`}}/gs), '')
.replace(regEx(/{{.+?}}/g), '');
}

export function extractPackageFile(
Expand Down

0 comments on commit adc056c

Please sign in to comment.