mirror of
https://github.com/element-hq/ess-helm.git
synced 2026-12-05 08:12:26 -08:00
Validate that workload selectors match the labels in the template.
This commit is contained in:
1 parent
fba881b11b
commit
64df3fc65e
2 files changed
+13
No files matched your search
@@ -0,0 +1 @@
|
||||
Validate that workload selectors match the labels in the template.
|
||||
@@ -128,3 +128,15 @@ async def test_our_labels_are_named_consistently(templates):
|
||||
assert has_match, (
|
||||
f"{template_id(template)} has label {our_label} that does not match one of {acceptable_matches=}"
|
||||
)
|
||||
|
||||
|
||||
@pytest.mark.parametrize("values_file", values_files_to_test)
|
||||
@pytest.mark.asyncio_cooperative
|
||||
async def test_workloads_selector_matches_labels(templates):
|
||||
for template in templates:
|
||||
if template["kind"] in ("Deployment", "StatefulSet"):
|
||||
for label in template["spec"]["selector"]["matchLabels"]:
|
||||
assert (
|
||||
template["spec"]["template"]["metadata"]["labels"][label]
|
||||
== template["spec"]["selector"]["matchLabels"][label]
|
||||
)
|
||||
Reference in new issue
Block a user