Skip to content

Commit e0b02f3

Browse files
authored
Merge pull request #791 from element-hq/bbz/template-ingress-hosts-in-notes
Template `<component>.ingress.host` correctly in `NOTES.txt`
2 parents 1d2fc54 + de2bec0 commit e0b02f3

File tree

4 files changed

+18
-3
lines changed

4 files changed

+18
-3
lines changed

charts/matrix-stack/templates/NOTES.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,13 @@ kubectl exec -n {{ $.Release.Namespace }} -it deployment/{{ $.Release.Name }}-ma
3030

3131
{{- if and $.Values.elementWeb.enabled $.Values.elementWeb.ingress.host }}
3232

33-
Your chat client is available at: https://{{ $.Values.elementWeb.ingress.host }}
33+
Your chat client is available at: https://{{ tpl $.Values.elementWeb.ingress.host $ }}
3434
{{- end }}
3535
{{- if and $.Values.matrixAuthenticationService.enabled $.Values.matrixAuthenticationService.ingress.host }}
3636

37-
You can manage your account at: https://{{ $.Values.matrixAuthenticationService.ingress.host }}
37+
You can manage your account at: https://{{ tpl $.Values.matrixAuthenticationService.ingress.host $ }}
3838
{{- end }}
3939
{{- if $.Values.wellKnownDelegation.enabled }}
4040

41-
To successfully federate, make sure that the Well-Known Delegation works properly using the matrix-federation-tester: https://federationtester.matrix.org/#{{ $.Values.serverName }}
41+
To successfully federate, make sure that the Well-Known Delegation works properly using the matrix-federation-tester: https://federationtester.matrix.org/#{{ tpl $.Values.serverName $ }}
4242
{{- end }}

newsfragments/791.fixed.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix templated `<component>.ingress.host` values not being rendered correctly in `NOTES.txt`.

newsfragments/791.internal.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
CI: add a test that we don't have anything that looks like a template string in the rendered files.

tests/manifests/test_basic.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
# SPDX-License-Identifier: AGPL-3.0-only
44

55
import pytest
6+
import yaml
67

78
from . import PropertyType, all_deployables_details, values_files_to_test
89
from .utils import template_id
@@ -123,3 +124,15 @@ async def test_default_values_file_sets_stub_values(base_values):
123124
assert hostAliases == unset_marker, (
124125
f"{deployable_details.name} has default {hostAliases=} rather than being unset"
125126
)
127+
128+
129+
@pytest.mark.parametrize("values_file", values_files_to_test)
130+
@pytest.mark.asyncio_cooperative
131+
async def test_doesnt_contain_any_unrendered_helm_templates(templates):
132+
# This test does not cover `NOTES.txt` as https://github.com/helm/helm/issues/6901
133+
for template in templates:
134+
for idx, line in enumerate(yaml.safe_dump(template).splitlines()):
135+
assert ".Values." not in line, (
136+
f"{template_id(template)} contains what looks like an un-rendered Helm template "
137+
f"on line number {idx + 1}"
138+
)

0 commit comments

Comments
 (0)