Merge pull request #1669 from element-hq/bbz/test-for-bare-servicenames

Check that Service references are fully-qualified
This commit is contained in:
Ben Banfield-Zanin authored and GitHub committed 2026-10-13 16:34:05 +01:00
commit 4ccac7cf21
2 files changed
+10 -1

No files matched your search

+1
View File
@@ -0,0 +1 @@
CI: test that references in `Services` are fully-qualified.
+9 -1
View File
@@ -514,7 +514,9 @@ async def test_not_too_many_ports_in_services(templates):
@pytest.mark.parametrize("values_file", values_files_to_test)
@pytest.mark.asyncio_cooperative
async def test_references_to_services_are_anchored_by_the_cluster_domain(values, make_templates):
async def test_references_to_services_are_anchored_by_the_cluster_domain(
values, make_templates, release_name, namespace
):
"""
Service references must use proper cluster domain anchoring.
@@ -534,6 +536,12 @@ async def test_references_to_services_are_anchored_by_the_cluster_domain(values,
f"Expected '.svc.cluster.local.' but found '{line.strip()}'. "
f"Service references must be fully qualified with the cluster domain."
)
if f"://{release_name}-" in line:
assert f".{namespace}.svc.cluster.local." in line, (
f"{template_id(template)} contains service reference that isn't properly anchored: {line=}. "
f"Expected '.{namespace}.svc.cluster.local.' but found '{line.strip()}'. "
f"Service references must be fully qualified with the cluster domain."
)
values["clusterDomain"] = "k8s.example.com."
for template in await make_templates(values):