mirror of
https://github.com/element-hq/ess-helm.git
synced 2026-12-04 07:42:28 -08:00
Merge pull request #1669 from element-hq/bbz/test-for-bare-servicenames
Check that Service references are fully-qualified
This commit is contained in:
2 files changed
+10
-1
No files matched your search
@@ -0,0 +1 @@
|
||||
CI: test that references in `Services` are fully-qualified.
|
||||
@@ -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):
|
||||
|
||||
Reference in new issue
Block a user