|
2 | 2 | #
|
3 | 3 | # SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial
|
4 | 4 |
|
5 |
| -from typing import Any, Dict, Iterator |
| 5 | +from collections.abc import Iterator |
| 6 | +from typing import Any |
6 | 7 |
|
7 | 8 | import pytest
|
8 | 9 |
|
9 | 10 | from . import component_details, shared_components_details, values_files_to_test
|
10 | 11 |
|
11 | 12 |
|
12 |
| -def selector_match(labels: Dict[str, str], selector: Dict[str, str]) -> bool: |
| 13 | +def selector_match(labels: dict[str, str], selector: dict[str, str]) -> bool: |
13 | 14 | return all(labels[key] == value for key, value in selector.items())
|
14 | 15 |
|
15 | 16 |
|
16 |
| -def find_services_matching_selector(templates: Iterator[Any], selector: Dict[str, str]) -> list[Any]: |
| 17 | +def find_services_matching_selector(templates: Iterator[Any], selector: dict[str, str]) -> list[Any]: |
17 | 18 | services = []
|
18 | 19 | for template in templates:
|
19 | 20 | if template["kind"] == "Service" and selector_match(template["metadata"]["labels"], selector):
|
20 | 21 | services.append(template)
|
21 | 22 | return services
|
22 | 23 |
|
23 | 24 |
|
24 |
| -def find_workload_ids_matching_selector(templates: Iterator[Any], selector: Dict[str, str]) -> list[str]: |
| 25 | +def find_workload_ids_matching_selector(templates: Iterator[Any], selector: dict[str, str]) -> list[str]: |
25 | 26 | workload_ids = []
|
26 | 27 | for template in templates:
|
27 | 28 | if template["kind"] in ("Deployment", "StatefulSet", "Job") and selector_match(
|
|
0 commit comments