qontract-reconcile 0.10.1rc884__py3-none-any.whl → 0.10.1rc885__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {qontract_reconcile-0.10.1rc884.dist-info → qontract_reconcile-0.10.1rc885.dist-info}/METADATA +1 -1
- {qontract_reconcile-0.10.1rc884.dist-info → qontract_reconcile-0.10.1rc885.dist-info}/RECORD +276 -276
- reconcile/acs_rbac.py +1 -2
- reconcile/aus/advanced_upgrade_service.py +14 -14
- reconcile/aus/aus_label_source.py +1 -2
- reconcile/aus/base.py +23 -26
- reconcile/aus/cluster_version_data.py +4 -4
- reconcile/aus/models.py +2 -3
- reconcile/aus/version_gate_approver.py +2 -6
- reconcile/aus/version_gates/__init__.py +1 -3
- reconcile/aus/version_gates/sts_version_gate_handler.py +2 -3
- reconcile/aws_account_manager/integration.py +2 -2
- reconcile/aws_ami_cleanup/integration.py +3 -4
- reconcile/aws_iam_password_reset.py +2 -5
- reconcile/aws_version_sync/integration.py +2 -2
- reconcile/blackbox_exporter_endpoint_monitoring.py +2 -5
- reconcile/change_owners/approver.py +4 -5
- reconcile/change_owners/bundle.py +20 -22
- reconcile/change_owners/change_types.py +23 -24
- reconcile/change_owners/changes.py +13 -16
- reconcile/change_owners/decision.py +2 -5
- reconcile/change_owners/diff.py +11 -15
- reconcile/change_owners/self_service_roles.py +1 -2
- reconcile/change_owners/tester.py +7 -10
- reconcile/checkpoint.py +2 -5
- reconcile/cli.py +9 -12
- reconcile/closedbox_endpoint_monitoring_base.py +8 -11
- reconcile/cluster_deployment_mapper.py +2 -5
- reconcile/cna/assets/asset.py +4 -7
- reconcile/cna/assets/null.py +2 -5
- reconcile/cna/integration.py +2 -3
- reconcile/cna/state.py +2 -5
- reconcile/dashdotdb_base.py +8 -11
- reconcile/dashdotdb_cso.py +3 -6
- reconcile/dashdotdb_dora.py +10 -14
- reconcile/dashdotdb_dvo.py +10 -13
- reconcile/dashdotdb_slo.py +5 -8
- reconcile/database_access_manager.py +5 -6
- reconcile/dynatrace_token_provider/integration.py +2 -5
- reconcile/external_resources/integration.py +1 -1
- reconcile/external_resources/manager.py +4 -4
- reconcile/external_resources/model.py +3 -3
- reconcile/external_resources/secrets_sync.py +5 -5
- reconcile/external_resources/state.py +5 -5
- reconcile/gabi_authorized_users.py +3 -6
- reconcile/gcr_mirror.py +1 -1
- reconcile/github_org.py +1 -3
- reconcile/github_repo_invites.py +2 -5
- reconcile/gitlab_housekeeping.py +7 -11
- reconcile/gitlab_labeler.py +1 -2
- reconcile/gitlab_members.py +2 -5
- reconcile/gitlab_permissions.py +1 -3
- reconcile/glitchtip/integration.py +2 -5
- reconcile/glitchtip_project_alerts/integration.py +3 -6
- reconcile/glitchtip_project_dsn/integration.py +4 -7
- reconcile/integrations_manager.py +5 -8
- reconcile/jenkins/types.py +5 -6
- reconcile/jenkins_job_builder.py +9 -12
- reconcile/jenkins_roles.py +1 -1
- reconcile/jira_watcher.py +2 -2
- reconcile/ldap_groups/integration.py +2 -5
- reconcile/ocm/types.py +21 -26
- reconcile/ocm_addons_upgrade_tests_trigger.py +3 -6
- reconcile/ocm_clusters.py +8 -8
- reconcile/ocm_internal_notifications/integration.py +1 -2
- reconcile/ocm_labels/integration.py +2 -5
- reconcile/ocm_machine_pools.py +11 -15
- reconcile/ocm_upgrade_scheduler_org_updater.py +2 -5
- reconcile/openshift_base.py +27 -29
- reconcile/openshift_groups.py +15 -20
- reconcile/openshift_namespace_labels.py +8 -14
- reconcile/openshift_namespaces.py +5 -8
- reconcile/openshift_network_policies.py +2 -4
- reconcile/openshift_resources_base.py +19 -29
- reconcile/openshift_saas_deploy.py +9 -10
- reconcile/openshift_saas_deploy_change_tester.py +7 -10
- reconcile/openshift_saas_deploy_trigger_base.py +4 -7
- reconcile/openshift_saas_deploy_trigger_cleaner.py +5 -8
- reconcile/openshift_saas_deploy_trigger_configs.py +1 -2
- reconcile/openshift_saas_deploy_trigger_images.py +1 -2
- reconcile/openshift_saas_deploy_trigger_moving_commits.py +1 -2
- reconcile/openshift_saas_deploy_trigger_upstream_jobs.py +1 -2
- reconcile/openshift_tekton_resources.py +7 -11
- reconcile/openshift_upgrade_watcher.py +10 -13
- reconcile/openshift_users.py +8 -11
- reconcile/oum/base.py +3 -4
- reconcile/oum/labelset.py +1 -2
- reconcile/oum/metrics.py +2 -2
- reconcile/oum/models.py +1 -2
- reconcile/oum/standalone.py +2 -3
- reconcile/prometheus_rules_tester/integration.py +6 -9
- reconcile/quay_membership.py +1 -2
- reconcile/quay_mirror.py +12 -13
- reconcile/quay_mirror_org.py +10 -10
- reconcile/queries.py +4 -7
- reconcile/resource_scraper.py +3 -4
- reconcile/rhidp/common.py +2 -2
- reconcile/saas_auto_promotions_manager/integration.py +5 -6
- reconcile/saas_auto_promotions_manager/merge_request_manager/batcher.py +1 -2
- reconcile/saas_auto_promotions_manager/publisher.py +5 -6
- reconcile/saas_auto_promotions_manager/subscriber.py +3 -4
- reconcile/saas_file_validator.py +2 -5
- reconcile/signalfx_endpoint_monitoring.py +2 -5
- reconcile/skupper_network/integration.py +3 -6
- reconcile/skupper_network/models.py +3 -5
- reconcile/slack_base.py +4 -7
- reconcile/slack_usergroups.py +15 -17
- reconcile/sql_query.py +5 -9
- reconcile/status_board.py +4 -5
- reconcile/statuspage/atlassian.py +14 -15
- reconcile/statuspage/integrations/maintenances.py +3 -3
- reconcile/statuspage/page.py +8 -8
- reconcile/statuspage/state.py +4 -5
- reconcile/statuspage/status.py +7 -8
- reconcile/templating/lib/rendering.py +8 -8
- reconcile/templating/renderer.py +10 -11
- reconcile/templating/validator.py +4 -4
- reconcile/terraform_aws_route53.py +3 -6
- reconcile/terraform_cloudflare_dns.py +9 -12
- reconcile/terraform_cloudflare_resources.py +9 -11
- reconcile/terraform_cloudflare_users.py +8 -11
- reconcile/terraform_init/integration.py +2 -2
- reconcile/terraform_repo.py +11 -14
- reconcile/terraform_resources.py +20 -21
- reconcile/terraform_tgw_attachments.py +32 -36
- reconcile/terraform_users.py +6 -7
- reconcile/terraform_vpc_resources/integration.py +5 -5
- reconcile/test/conftest.py +7 -10
- reconcile/test/fixtures.py +1 -1
- reconcile/test/saas_auto_promotions_manager/conftest.py +2 -2
- reconcile/test/saas_auto_promotions_manager/merge_request_manager/renderer/conftest.py +2 -2
- reconcile/test/test_database_access_manager.py +3 -6
- reconcile/test/test_gitlab_labeler.py +2 -5
- reconcile/test/test_jump_host.py +5 -8
- reconcile/test/test_ocm_machine_pools.py +1 -4
- reconcile/test/test_openshift_base.py +3 -6
- reconcile/test/test_openshift_cluster_bots.py +5 -5
- reconcile/test/test_openshift_namespace_labels.py +2 -3
- reconcile/test/test_openshift_saas_deploy_trigger_cleaner.py +2 -2
- reconcile/test/test_saasherder.py +9 -12
- reconcile/test/test_slack_base.py +4 -6
- reconcile/test/test_status_board.py +4 -7
- reconcile/test/test_terraform_tgw_attachments.py +14 -20
- reconcile/typed_queries/alerting_services_settings.py +1 -2
- reconcile/typed_queries/app_interface_custom_messages.py +2 -3
- reconcile/typed_queries/app_interface_deadmanssnitch_settings.py +1 -3
- reconcile/typed_queries/app_interface_repo_url.py +1 -2
- reconcile/typed_queries/app_interface_state_settings.py +1 -3
- reconcile/typed_queries/app_interface_vault_settings.py +1 -2
- reconcile/typed_queries/aws_vpc_requests.py +1 -3
- reconcile/typed_queries/aws_vpcs.py +1 -3
- reconcile/typed_queries/clusters.py +2 -4
- reconcile/typed_queries/clusters_minimal.py +1 -3
- reconcile/typed_queries/clusters_with_dms.py +1 -3
- reconcile/typed_queries/external_resources.py +3 -4
- reconcile/typed_queries/pagerduty_instances.py +1 -2
- reconcile/typed_queries/repos.py +2 -3
- reconcile/typed_queries/reserved_networks.py +1 -3
- reconcile/typed_queries/saas_files.py +49 -59
- reconcile/typed_queries/slo_documents.py +1 -3
- reconcile/typed_queries/status_board.py +3 -7
- reconcile/typed_queries/tekton_pipeline_providers.py +1 -2
- reconcile/typed_queries/terraform_namespaces.py +1 -2
- reconcile/typed_queries/terraform_tgw_attachments/aws_accounts.py +1 -3
- reconcile/utils/acs/base.py +2 -3
- reconcile/utils/acs/notifiers.py +3 -3
- reconcile/utils/acs/policies.py +3 -3
- reconcile/utils/aggregated_list.py +1 -1
- reconcile/utils/amtool.py +1 -2
- reconcile/utils/aws_api.py +28 -31
- reconcile/utils/binary.py +1 -3
- reconcile/utils/clusterhealth/providerbase.py +1 -2
- reconcile/utils/clusterhealth/telemeter.py +2 -2
- reconcile/utils/deadmanssnitch_api.py +1 -2
- reconcile/utils/disabled_integrations.py +4 -6
- reconcile/utils/environ.py +1 -1
- reconcile/utils/expiration.py +3 -7
- reconcile/utils/external_resource_spec.py +3 -4
- reconcile/utils/external_resources.py +4 -7
- reconcile/utils/filtering.py +1 -2
- reconcile/utils/git.py +3 -9
- reconcile/utils/git_secrets.py +5 -5
- reconcile/utils/github_api.py +5 -9
- reconcile/utils/gitlab_api.py +2 -3
- reconcile/utils/glitchtip/client.py +2 -4
- reconcile/utils/glitchtip/models.py +8 -11
- reconcile/utils/gql.py +26 -35
- reconcile/utils/grouping.py +1 -3
- reconcile/utils/imap_client.py +2 -5
- reconcile/utils/internal_groups/client.py +1 -2
- reconcile/utils/internal_groups/models.py +8 -9
- reconcile/utils/jenkins_api.py +4 -4
- reconcile/utils/jinja2/extensions.py +1 -1
- reconcile/utils/jinja2/filters.py +4 -4
- reconcile/utils/jinja2/utils.py +16 -16
- reconcile/utils/jira_client.py +10 -11
- reconcile/utils/jjb_client.py +14 -17
- reconcile/utils/jobcontroller/controller.py +5 -5
- reconcile/utils/jobcontroller/models.py +2 -2
- reconcile/utils/jsonpath.py +4 -5
- reconcile/utils/jump_host.py +7 -8
- reconcile/utils/keycloak.py +3 -7
- reconcile/utils/ldap_client.py +2 -3
- reconcile/utils/lean_terraform_client.py +13 -17
- reconcile/utils/membershipsources/app_interface_resolver.py +1 -1
- reconcile/utils/membershipsources/models.py +19 -22
- reconcile/utils/metrics.py +13 -15
- reconcile/utils/mr/base.py +7 -11
- reconcile/utils/mr/glitchtip_access_reporter.py +2 -2
- reconcile/utils/mr/notificator.py +1 -2
- reconcile/utils/oc.py +32 -38
- reconcile/utils/oc_connection_parameters.py +24 -25
- reconcile/utils/oc_filters.py +2 -3
- reconcile/utils/oc_map.py +9 -15
- reconcile/utils/ocm/addons.py +7 -10
- reconcile/utils/ocm/base.py +38 -39
- reconcile/utils/ocm/clusters.py +6 -9
- reconcile/utils/ocm/label_sources.py +1 -2
- reconcile/utils/ocm/labels.py +3 -6
- reconcile/utils/ocm/ocm.py +11 -14
- reconcile/utils/ocm/products.py +1 -3
- reconcile/utils/ocm/search_filters.py +16 -17
- reconcile/utils/ocm/service_log.py +2 -3
- reconcile/utils/ocm/sre_capability_labels.py +4 -8
- reconcile/utils/ocm/subscriptions.py +1 -3
- reconcile/utils/ocm/syncsets.py +2 -4
- reconcile/utils/ocm/upgrades.py +5 -9
- reconcile/utils/ocm_base_client.py +13 -16
- reconcile/utils/openshift_resource.py +5 -11
- reconcile/utils/output.py +2 -3
- reconcile/utils/pagerduty_api.py +4 -5
- reconcile/utils/prometheus.py +2 -2
- reconcile/utils/promotion_state.py +4 -5
- reconcile/utils/promtool.py +2 -8
- reconcile/utils/quay_api.py +12 -22
- reconcile/utils/raw_github_api.py +3 -5
- reconcile/utils/rosa/rosa_cli.py +6 -6
- reconcile/utils/rosa/session.py +6 -7
- reconcile/utils/runtime/desired_state_diff.py +3 -8
- reconcile/utils/runtime/environment.py +4 -7
- reconcile/utils/runtime/integration.py +4 -4
- reconcile/utils/runtime/meta.py +1 -2
- reconcile/utils/runtime/runner.py +7 -10
- reconcile/utils/runtime/sharding.py +22 -27
- reconcile/utils/saasherder/interfaces.py +63 -69
- reconcile/utils/saasherder/models.py +30 -35
- reconcile/utils/saasherder/saasherder.py +37 -53
- reconcile/utils/secret_reader.py +17 -19
- reconcile/utils/slack_api.py +15 -17
- reconcile/utils/smtp_client.py +1 -2
- reconcile/utils/sqs_gateway.py +1 -3
- reconcile/utils/state.py +1 -2
- reconcile/utils/terraform/config_client.py +4 -5
- reconcile/utils/terraform_client.py +3 -8
- reconcile/utils/terrascript/cloudflare_client.py +4 -10
- reconcile/utils/terrascript/cloudflare_resources.py +10 -13
- reconcile/utils/terrascript/models.py +2 -3
- reconcile/utils/terrascript/resources.py +1 -2
- reconcile/utils/terrascript_aws_client.py +30 -38
- reconcile/utils/unleash/client.py +4 -7
- reconcile/utils/unleash/server.py +2 -2
- reconcile/utils/vault.py +8 -11
- reconcile/utils/vaultsecretref.py +2 -3
- reconcile/utils/vcs.py +7 -8
- reconcile/vault_replication.py +4 -8
- reconcile/vpc_peerings_validator.py +4 -9
- release/version.py +6 -7
- tools/app_interface_reporter.py +2 -2
- tools/cli_commands/gpg_encrypt.py +3 -6
- tools/cli_commands/systems_and_tools.py +4 -7
- tools/qontract_cli.py +12 -17
- tools/template_validation.py +1 -1
- tools/test/conftest.py +3 -6
- {qontract_reconcile-0.10.1rc884.dist-info → qontract_reconcile-0.10.1rc885.dist-info}/WHEEL +0 -0
- {qontract_reconcile-0.10.1rc884.dist-info → qontract_reconcile-0.10.1rc885.dist-info}/entry_points.txt +0 -0
- {qontract_reconcile-0.10.1rc884.dist-info → qontract_reconcile-0.10.1rc885.dist-info}/top_level.txt +0 -0
@@ -1,7 +1,4 @@
|
|
1
|
-
from
|
2
|
-
Callable,
|
3
|
-
Optional,
|
4
|
-
)
|
1
|
+
from collections.abc import Callable
|
5
2
|
from unittest.mock import call
|
6
3
|
|
7
4
|
import pytest
|
@@ -19,9 +16,9 @@ from reconcile.utils.ocm_base_client import OCMBaseClient
|
|
19
16
|
|
20
17
|
|
21
18
|
class StatusBoardStub(AbstractStatusBoard):
|
22
|
-
created:
|
23
|
-
deleted:
|
24
|
-
summarized:
|
19
|
+
created: bool | None = False
|
20
|
+
deleted: bool | None = False
|
21
|
+
summarized: bool | None = False
|
25
22
|
|
26
23
|
def create(self, ocm: OCMBaseClient) -> None:
|
27
24
|
self.created = True
|
@@ -3,10 +3,6 @@ from collections.abc import (
|
|
3
3
|
Iterable,
|
4
4
|
Mapping,
|
5
5
|
)
|
6
|
-
from typing import (
|
7
|
-
Optional,
|
8
|
-
Union,
|
9
|
-
)
|
10
6
|
from unittest.mock import create_autospec
|
11
7
|
|
12
8
|
import pytest
|
@@ -162,10 +158,10 @@ def peering_connection_builder(
|
|
162
158
|
name: str,
|
163
159
|
provider: str,
|
164
160
|
manage_routes: bool = False,
|
165
|
-
account:
|
166
|
-
assume_role:
|
167
|
-
cidr_block:
|
168
|
-
delete:
|
161
|
+
account: ClusterPeeringConnectionAccountTGWV1_AWSAccountV1 | None = None,
|
162
|
+
assume_role: str | None = None,
|
163
|
+
cidr_block: str | None = None,
|
164
|
+
delete: bool | None = None,
|
169
165
|
) -> ClusterPeeringConnectionAccountTGWV1:
|
170
166
|
return gql_class_factory(
|
171
167
|
ClusterPeeringConnectionAccountTGWV1,
|
@@ -260,13 +256,11 @@ def peering_builder(
|
|
260
256
|
) -> Callable[..., ClusterPeeringV1]:
|
261
257
|
def builder(
|
262
258
|
connections: list[
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
ClusterPeeringConnectionV1,
|
269
|
-
]
|
259
|
+
ClusterPeeringConnectionAccountTGWV1
|
260
|
+
| ClusterPeeringConnectionAccountV1
|
261
|
+
| ClusterPeeringConnectionAccountVPCMeshV1
|
262
|
+
| ClusterPeeringConnectionClusterRequesterV1
|
263
|
+
| ClusterPeeringConnectionV1
|
270
264
|
],
|
271
265
|
) -> ClusterPeeringV1:
|
272
266
|
return gql_class_factory(
|
@@ -504,11 +498,11 @@ def build_expected_desired_state_item(
|
|
504
498
|
def _setup_mocks(
|
505
499
|
mocker: MockerFixture,
|
506
500
|
vault_settings: AppInterfaceSettingsV1,
|
507
|
-
clusters:
|
508
|
-
accounts:
|
509
|
-
vpc_details:
|
510
|
-
tgws:
|
511
|
-
assume_role:
|
501
|
+
clusters: Iterable[ClusterV1] | None = None,
|
502
|
+
accounts: Iterable[AWSAccountV1] | None = None,
|
503
|
+
vpc_details: Mapping | None = None,
|
504
|
+
tgws: Iterable | None = None,
|
505
|
+
assume_role: str | None = None,
|
512
506
|
feature_toggle_state: bool = True,
|
513
507
|
) -> dict:
|
514
508
|
mocked_gql_api = create_autospec(GqlApi)
|
@@ -1,12 +1,11 @@
|
|
1
1
|
from collections.abc import Callable
|
2
|
-
from typing import Optional
|
3
2
|
|
4
3
|
from reconcile.gql_definitions.common.alerting_services_settings import query
|
5
4
|
from reconcile.utils import gql
|
6
5
|
from reconcile.utils.exceptions import AppInterfaceSettingsError
|
7
6
|
|
8
7
|
|
9
|
-
def get_alerting_services(query_func:
|
8
|
+
def get_alerting_services(query_func: Callable | None = None) -> set[str]:
|
10
9
|
"""Get alertingServices from app-interface settings"""
|
11
10
|
|
12
11
|
if not query_func:
|
@@ -1,5 +1,4 @@
|
|
1
1
|
from collections.abc import Callable
|
2
|
-
from typing import Optional
|
3
2
|
|
4
3
|
from reconcile.gql_definitions.common.app_interface_custom_messages import (
|
5
4
|
query,
|
@@ -9,8 +8,8 @@ from reconcile.utils import gql
|
|
9
8
|
|
10
9
|
def get_app_interface_custom_message(
|
11
10
|
desired_id: str,
|
12
|
-
query_func:
|
13
|
-
) ->
|
11
|
+
query_func: Callable | None = None,
|
12
|
+
) -> str | None:
|
14
13
|
"""Returns App Interface Custom Message by ID or None if not found"""
|
15
14
|
if not query_func:
|
16
15
|
query_func = gql.get_api().query
|
@@ -1,5 +1,3 @@
|
|
1
|
-
from typing import Optional
|
2
|
-
|
3
1
|
from reconcile.gql_definitions.common.app_interface_dms_settings import (
|
4
2
|
DeadMansSnitchSettingsV1,
|
5
3
|
query,
|
@@ -10,7 +8,7 @@ from reconcile.utils.gql import GqlApi
|
|
10
8
|
|
11
9
|
|
12
10
|
def get_deadmanssnitch_settings(
|
13
|
-
gql_api:
|
11
|
+
gql_api: GqlApi | None = None,
|
14
12
|
) -> DeadMansSnitchSettingsV1:
|
15
13
|
api = gql_api if gql_api else gql.get_api()
|
16
14
|
data = query(query_func=api.query)
|
@@ -1,12 +1,11 @@
|
|
1
1
|
from collections.abc import Callable
|
2
|
-
from typing import Optional
|
3
2
|
|
4
3
|
from reconcile.gql_definitions.common.app_interface_repo_settings import query
|
5
4
|
from reconcile.utils import gql
|
6
5
|
from reconcile.utils.exceptions import AppInterfaceSettingsError
|
7
6
|
|
8
7
|
|
9
|
-
def get_app_interface_repo_url(query_func:
|
8
|
+
def get_app_interface_repo_url(query_func: Callable | None = None) -> str:
|
10
9
|
if not query_func:
|
11
10
|
gqlapi = gql.get_api()
|
12
11
|
query_func = gqlapi.query
|
@@ -1,5 +1,3 @@
|
|
1
|
-
from typing import Optional
|
2
|
-
|
3
1
|
from reconcile.gql_definitions.common.app_interface_state_settings import (
|
4
2
|
AppInterfaceStateConfigurationV1,
|
5
3
|
query,
|
@@ -7,7 +5,7 @@ from reconcile.gql_definitions.common.app_interface_state_settings import (
|
|
7
5
|
from reconcile.utils import gql
|
8
6
|
|
9
7
|
|
10
|
-
def get_app_interface_state_settings() ->
|
8
|
+
def get_app_interface_state_settings() -> AppInterfaceStateConfigurationV1 | None:
|
11
9
|
"""Returns App Interface Settings"""
|
12
10
|
gqlapi = gql.get_api()
|
13
11
|
data = query(gqlapi.query)
|
@@ -1,5 +1,4 @@
|
|
1
1
|
from collections.abc import Callable
|
2
|
-
from typing import Optional
|
3
2
|
|
4
3
|
from reconcile.gql_definitions.common.app_interface_vault_settings import (
|
5
4
|
AppInterfaceSettingsV1,
|
@@ -10,7 +9,7 @@ from reconcile.utils.exceptions import AppInterfaceSettingsError
|
|
10
9
|
|
11
10
|
|
12
11
|
def get_app_interface_vault_settings(
|
13
|
-
query_func:
|
12
|
+
query_func: Callable | None = None,
|
14
13
|
) -> AppInterfaceSettingsV1:
|
15
14
|
"""Returns App Interface Settings and raises err if none are found"""
|
16
15
|
if not query_func:
|
@@ -1,11 +1,9 @@
|
|
1
|
-
from typing import Optional
|
2
|
-
|
3
1
|
from reconcile.gql_definitions.common.aws_vpc_requests import VPCRequest, query
|
4
2
|
from reconcile.utils import gql
|
5
3
|
from reconcile.utils.gql import GqlApi
|
6
4
|
|
7
5
|
|
8
|
-
def get_aws_vpc_requests(gql_api:
|
6
|
+
def get_aws_vpc_requests(gql_api: GqlApi | None = None) -> list[VPCRequest]:
|
9
7
|
api = gql_api if gql_api else gql.get_api()
|
10
8
|
data = query(query_func=api.query)
|
11
9
|
return list(data.vpc_requests or [])
|
@@ -1,5 +1,3 @@
|
|
1
|
-
from typing import Optional
|
2
|
-
|
3
1
|
from reconcile.gql_definitions.common.aws_vpcs import (
|
4
2
|
AWSVPC,
|
5
3
|
query,
|
@@ -8,7 +6,7 @@ from reconcile.utils import gql
|
|
8
6
|
from reconcile.utils.gql import GqlApi
|
9
7
|
|
10
8
|
|
11
|
-
def get_aws_vpcs(gql_api:
|
9
|
+
def get_aws_vpcs(gql_api: GqlApi | None = None) -> list[AWSVPC]:
|
12
10
|
api = gql_api if gql_api else gql.get_api()
|
13
11
|
data = query(query_func=api.query)
|
14
12
|
return list(data.vpcs or [])
|
@@ -1,5 +1,3 @@
|
|
1
|
-
from typing import Optional
|
2
|
-
|
3
1
|
from reconcile.gql_definitions.common.clusters import (
|
4
2
|
ClusterV1,
|
5
3
|
query,
|
@@ -9,8 +7,8 @@ from reconcile.utils.gql import GqlApi
|
|
9
7
|
|
10
8
|
|
11
9
|
def get_clusters(
|
12
|
-
gql_api:
|
13
|
-
name:
|
10
|
+
gql_api: GqlApi | None = None,
|
11
|
+
name: str | None = None,
|
14
12
|
) -> list[ClusterV1]:
|
15
13
|
variables = {}
|
16
14
|
if name:
|
@@ -1,5 +1,3 @@
|
|
1
|
-
from typing import Optional
|
2
|
-
|
3
1
|
from reconcile.gql_definitions.common.clusters_minimal import (
|
4
2
|
ClusterV1,
|
5
3
|
query,
|
@@ -9,7 +7,7 @@ from reconcile.utils.gql import GqlApi
|
|
9
7
|
|
10
8
|
|
11
9
|
def get_clusters_minimal(
|
12
|
-
gql_api:
|
10
|
+
gql_api: GqlApi | None = None, name: str | None = None
|
13
11
|
) -> list[ClusterV1]:
|
14
12
|
variables = {}
|
15
13
|
if name:
|
@@ -1,5 +1,3 @@
|
|
1
|
-
from typing import Optional
|
2
|
-
|
3
1
|
from reconcile.gql_definitions.common.clusters_with_dms import (
|
4
2
|
ClusterV1,
|
5
3
|
query,
|
@@ -9,7 +7,7 @@ from reconcile.utils.gql import GqlApi
|
|
9
7
|
|
10
8
|
|
11
9
|
def get_clusters_with_dms(
|
12
|
-
gql_api:
|
10
|
+
gql_api: GqlApi | None = None,
|
13
11
|
) -> list[ClusterV1]:
|
14
12
|
# get the clusters containing the filed enableDeadMansSnitch
|
15
13
|
variable = {"filter": {"enableDeadMansSnitch": {"ne": None}}}
|
@@ -1,5 +1,4 @@
|
|
1
1
|
from collections.abc import Callable
|
2
|
-
from typing import Optional
|
3
2
|
|
4
3
|
from reconcile.gql_definitions.external_resources.external_resources_modules import (
|
5
4
|
ExternalResourcesModuleV1,
|
@@ -22,7 +21,7 @@ from reconcile.gql_definitions.external_resources.external_resources_settings im
|
|
22
21
|
from reconcile.utils import gql
|
23
22
|
|
24
23
|
|
25
|
-
def get_namespaces(query_func:
|
24
|
+
def get_namespaces(query_func: Callable | None = None) -> list[NamespaceV1]:
|
26
25
|
if not query_func:
|
27
26
|
query_func = gql.get_api().query
|
28
27
|
data = query_namespaces(query_func=query_func)
|
@@ -30,7 +29,7 @@ def get_namespaces(query_func: Optional[Callable] = None) -> list[NamespaceV1]:
|
|
30
29
|
|
31
30
|
|
32
31
|
def get_settings(
|
33
|
-
query_func:
|
32
|
+
query_func: Callable | None = None,
|
34
33
|
) -> list[ExternalResourcesSettingsV1]:
|
35
34
|
if not query_func:
|
36
35
|
query_func = gql.get_api().query
|
@@ -39,7 +38,7 @@ def get_settings(
|
|
39
38
|
|
40
39
|
|
41
40
|
def get_modules(
|
42
|
-
query_func:
|
41
|
+
query_func: Callable | None = None,
|
43
42
|
) -> list[ExternalResourcesModuleV1]:
|
44
43
|
if not query_func:
|
45
44
|
query_func = gql.get_api().query
|
@@ -1,5 +1,4 @@
|
|
1
1
|
from collections.abc import Callable
|
2
|
-
from typing import Optional
|
3
2
|
|
4
3
|
from reconcile.gql_definitions.common.pagerduty_instances import (
|
5
4
|
PagerDutyInstanceV1,
|
@@ -9,7 +8,7 @@ from reconcile.utils import gql
|
|
9
8
|
|
10
9
|
|
11
10
|
def get_pagerduty_instances(
|
12
|
-
query_func:
|
11
|
+
query_func: Callable | None,
|
13
12
|
) -> list[PagerDutyInstanceV1]:
|
14
13
|
"""Return all pagerduty instances from app-interface."""
|
15
14
|
if not query_func:
|
reconcile/typed_queries/repos.py
CHANGED
@@ -1,5 +1,4 @@
|
|
1
1
|
from collections.abc import Callable
|
2
|
-
from typing import Optional
|
3
2
|
|
4
3
|
from reconcile.gql_definitions.common.app_code_component_repos import (
|
5
4
|
AppCodeComponentsV1,
|
@@ -10,7 +9,7 @@ from reconcile.utils import gql
|
|
10
9
|
|
11
10
|
def get_code_components(
|
12
11
|
server: str = "",
|
13
|
-
query_func:
|
12
|
+
query_func: Callable | None = None,
|
14
13
|
) -> list[AppCodeComponentsV1]:
|
15
14
|
if not query_func:
|
16
15
|
query_func = gql.get_api().query
|
@@ -24,7 +23,7 @@ def get_code_components(
|
|
24
23
|
|
25
24
|
def get_repos(
|
26
25
|
server: str = "",
|
27
|
-
query_func:
|
26
|
+
query_func: Callable | None = None,
|
28
27
|
) -> list[str]:
|
29
28
|
code_components = get_code_components(server=server, query_func=query_func)
|
30
29
|
return [c.url for c in code_components]
|
@@ -1,5 +1,3 @@
|
|
1
|
-
from typing import Optional
|
2
|
-
|
3
1
|
from reconcile.gql_definitions.common.reserved_networks import (
|
4
2
|
NetworkV1,
|
5
3
|
query,
|
@@ -8,7 +6,7 @@ from reconcile.utils import gql
|
|
8
6
|
from reconcile.utils.gql import GqlApi
|
9
7
|
|
10
8
|
|
11
|
-
def get_networks(gql_api:
|
9
|
+
def get_networks(gql_api: GqlApi | None = None) -> list[NetworkV1]:
|
12
10
|
api = gql_api if gql_api else gql.get_api()
|
13
11
|
data = query(query_func=api.query)
|
14
12
|
return list(data.networks or [])
|
@@ -2,11 +2,7 @@ import hashlib
|
|
2
2
|
import json
|
3
3
|
from collections.abc import Callable
|
4
4
|
from threading import Lock
|
5
|
-
from typing import
|
6
|
-
Any,
|
7
|
-
Optional,
|
8
|
-
Union,
|
9
|
-
)
|
5
|
+
from typing import Any
|
10
6
|
|
11
7
|
from jsonpath_ng.exceptions import JsonPathParserError
|
12
8
|
from pydantic import (
|
@@ -55,24 +51,22 @@ from reconcile.utils.jsonpath import parse_jsonpath
|
|
55
51
|
|
56
52
|
|
57
53
|
class SaasResourceTemplateTarget(ConfiguredBaseModel):
|
58
|
-
path:
|
59
|
-
name:
|
54
|
+
path: str | None = Field(..., alias="path")
|
55
|
+
name: str | None = Field(..., alias="name")
|
60
56
|
# the namespace must be required to fulfill the saas file schema (utils.saasherder.interface.SaasFile)
|
61
57
|
namespace: SaasTargetNamespace = Field(..., alias="namespace")
|
62
58
|
ref: str = Field(..., alias="ref")
|
63
|
-
promotion:
|
59
|
+
promotion: SaasResourceTemplateTargetPromotionV1 | None = Field(
|
64
60
|
..., alias="promotion"
|
65
61
|
)
|
66
|
-
parameters:
|
67
|
-
secret_parameters:
|
68
|
-
list[SaasResourceTemplateTargetV2_SaasSecretParametersV1]
|
69
|
-
|
70
|
-
upstream:
|
71
|
-
|
72
|
-
)
|
73
|
-
|
74
|
-
disable: Optional[bool] = Field(..., alias="disable")
|
75
|
-
delete: Optional[bool] = Field(..., alias="delete")
|
62
|
+
parameters: Json | None = Field(..., alias="parameters")
|
63
|
+
secret_parameters: (
|
64
|
+
list[SaasResourceTemplateTargetV2_SaasSecretParametersV1] | None
|
65
|
+
) = Field(..., alias="secretParameters")
|
66
|
+
upstream: SaasResourceTemplateTargetUpstreamV1 | None = Field(..., alias="upstream")
|
67
|
+
image: SaasResourceTemplateTargetImageV1 | None = Field(..., alias="image")
|
68
|
+
disable: bool | None = Field(..., alias="disable")
|
69
|
+
delete: bool | None = Field(..., alias="delete")
|
76
70
|
|
77
71
|
def uid(
|
78
72
|
self, parent_saas_file_name: str, parent_resource_template_name: str
|
@@ -92,10 +86,10 @@ class SaasResourceTemplate(ConfiguredBaseModel):
|
|
92
86
|
name: str = Field(..., alias="name")
|
93
87
|
url: str = Field(..., alias="url")
|
94
88
|
path: str = Field(..., alias="path")
|
95
|
-
provider:
|
96
|
-
hash_length:
|
97
|
-
parameters:
|
98
|
-
secret_parameters:
|
89
|
+
provider: str | None = Field(..., alias="provider")
|
90
|
+
hash_length: int | None = Field(..., alias="hash_length")
|
91
|
+
parameters: Json | None = Field(..., alias="parameters")
|
92
|
+
secret_parameters: list[SaasResourceTemplateV2_SaasSecretParametersV1] | None = (
|
99
93
|
Field(..., alias="secretParameters")
|
100
94
|
)
|
101
95
|
targets: list[SaasResourceTemplateTarget] = Field(..., alias="targets")
|
@@ -104,53 +98,49 @@ class SaasResourceTemplate(ConfiguredBaseModel):
|
|
104
98
|
class SaasFile(ConfiguredBaseModel):
|
105
99
|
path: str = Field(..., alias="path")
|
106
100
|
name: str = Field(..., alias="name")
|
107
|
-
labels:
|
101
|
+
labels: Json | None = Field(..., alias="labels")
|
108
102
|
app: AppV1 = Field(..., alias="app")
|
109
|
-
pipelines_provider:
|
103
|
+
pipelines_provider: PipelinesProviderTektonV1 | PipelinesProviderV1 = Field(
|
110
104
|
..., alias="pipelinesProvider"
|
111
105
|
)
|
112
|
-
deploy_resources:
|
113
|
-
slack:
|
106
|
+
deploy_resources: DeployResourcesV1 | None = Field(..., alias="deployResources")
|
107
|
+
slack: SlackOutputV1 | None = Field(..., alias="slack")
|
114
108
|
managed_resource_types: list[str] = Field(..., alias="managedResourceTypes")
|
115
|
-
takeover:
|
116
|
-
deprecated:
|
117
|
-
compare:
|
118
|
-
timeout:
|
119
|
-
skip_successful_deploy_notifications:
|
109
|
+
takeover: bool | None = Field(..., alias="takeover")
|
110
|
+
deprecated: bool | None = Field(..., alias="deprecated")
|
111
|
+
compare: bool | None = Field(..., alias="compare")
|
112
|
+
timeout: str | None = Field(..., alias="timeout")
|
113
|
+
skip_successful_deploy_notifications: bool | None = Field(
|
120
114
|
..., alias="skipSuccessfulDeployNotifications"
|
121
115
|
)
|
122
|
-
publish_job_logs:
|
123
|
-
cluster_admin:
|
116
|
+
publish_job_logs: bool | None = Field(..., alias="publishJobLogs")
|
117
|
+
cluster_admin: bool | None = Field(..., alias="clusterAdmin")
|
124
118
|
image_patterns: list[str] = Field(..., alias="imagePatterns")
|
125
|
-
allowed_secret_parameter_paths:
|
119
|
+
allowed_secret_parameter_paths: list[str] | None = Field(
|
126
120
|
..., alias="allowedSecretParameterPaths"
|
127
121
|
)
|
128
|
-
use_channel_in_image_tag:
|
129
|
-
|
130
|
-
)
|
131
|
-
|
132
|
-
..., alias="authentication"
|
133
|
-
)
|
134
|
-
parameters: Optional[Json] = Field(..., alias="parameters")
|
135
|
-
secret_parameters: Optional[list[SaasSecretParametersV1]] = Field(
|
122
|
+
use_channel_in_image_tag: bool | None = Field(..., alias="use_channel_in_image_tag")
|
123
|
+
authentication: SaasFileAuthenticationV1 | None = Field(..., alias="authentication")
|
124
|
+
parameters: Json | None = Field(..., alias="parameters")
|
125
|
+
secret_parameters: list[SaasSecretParametersV1] | None = Field(
|
136
126
|
..., alias="secretParameters"
|
137
127
|
)
|
138
|
-
validate_targets_in_app:
|
139
|
-
managed_resource_names:
|
128
|
+
validate_targets_in_app: bool | None = Field(..., alias="validateTargetsInApp")
|
129
|
+
managed_resource_names: list[ManagedResourceNamesV1] | None = Field(
|
140
130
|
..., alias="managedResourceNames"
|
141
131
|
)
|
142
132
|
resource_templates: list[SaasResourceTemplate] = Field(
|
143
133
|
..., alias="resourceTemplates"
|
144
134
|
)
|
145
|
-
self_service_roles:
|
135
|
+
self_service_roles: list[RoleV1] | None = Field(..., alias="selfServiceRoles")
|
146
136
|
|
147
137
|
|
148
138
|
class SaasFileList:
|
149
139
|
def __init__(
|
150
140
|
self,
|
151
|
-
name:
|
152
|
-
query_func:
|
153
|
-
namespaces:
|
141
|
+
name: str | None = None,
|
142
|
+
query_func: Callable | None = None,
|
143
|
+
namespaces: list[SaasTargetNamespace] | None = None,
|
154
144
|
) -> None:
|
155
145
|
# query_func and namespaces are optional args mostly used in tests
|
156
146
|
if not query_func:
|
@@ -170,7 +160,7 @@ class SaasFileList:
|
|
170
160
|
self.saas_files = self._resolve_namespace_selectors()
|
171
161
|
|
172
162
|
def _init_caches(self) -> None:
|
173
|
-
self._namespaces_as_dict_cache:
|
163
|
+
self._namespaces_as_dict_cache: dict[str, list[Any]] | None = None
|
174
164
|
self._namespaces_as_dict_lock = Lock()
|
175
165
|
self._matching_namespaces_cache: dict[str, Any] = {}
|
176
166
|
self._matching_namespaces_lock = Lock()
|
@@ -272,9 +262,9 @@ class SaasFileList:
|
|
272
262
|
|
273
263
|
def where(
|
274
264
|
self,
|
275
|
-
name:
|
276
|
-
env_name:
|
277
|
-
app_name:
|
265
|
+
name: str | None = None,
|
266
|
+
env_name: str | None = None,
|
267
|
+
app_name: str | None = None,
|
278
268
|
) -> list[SaasFile]:
|
279
269
|
if name is None and env_name is None and app_name is None:
|
280
270
|
return self.saas_files
|
@@ -325,12 +315,12 @@ def export_model(model: BaseModel) -> dict[str, Any]:
|
|
325
315
|
|
326
316
|
|
327
317
|
def get_saas_files(
|
328
|
-
name:
|
329
|
-
env_name:
|
330
|
-
app_name:
|
331
|
-
query_func:
|
332
|
-
namespaces:
|
333
|
-
saas_file_list:
|
318
|
+
name: str | None = None,
|
319
|
+
env_name: str | None = None,
|
320
|
+
app_name: str | None = None,
|
321
|
+
query_func: Callable | None = None,
|
322
|
+
namespaces: list[SaasTargetNamespace] | None = None,
|
323
|
+
saas_file_list: SaasFileList | None = None,
|
334
324
|
) -> list[SaasFile]:
|
335
325
|
if not saas_file_list:
|
336
326
|
saas_file_list = SaasFileList(
|
@@ -340,7 +330,7 @@ def get_saas_files(
|
|
340
330
|
|
341
331
|
|
342
332
|
def get_saasherder_settings(
|
343
|
-
query_func:
|
333
|
+
query_func: Callable | None = None,
|
344
334
|
) -> AppInterfaceSettingsV1:
|
345
335
|
if not query_func:
|
346
336
|
query_func = gql.get_api().query
|
@@ -1,5 +1,3 @@
|
|
1
|
-
from typing import Optional
|
2
|
-
|
3
1
|
from reconcile.gql_definitions.slo_documents.slo_documents import (
|
4
2
|
SLODocumentV1,
|
5
3
|
query,
|
@@ -8,7 +6,7 @@ from reconcile.utils import gql
|
|
8
6
|
from reconcile.utils.gql import GqlApi
|
9
7
|
|
10
8
|
|
11
|
-
def get_slo_documents(gql_api:
|
9
|
+
def get_slo_documents(gql_api: GqlApi | None = None) -> list[SLODocumentV1]:
|
12
10
|
api = gql_api if gql_api else gql.get_api()
|
13
11
|
data = query(query_func=api.query)
|
14
12
|
return data.slo_document_v1 or []
|
@@ -1,9 +1,5 @@
|
|
1
|
-
from
|
2
|
-
|
3
|
-
Callable,
|
4
|
-
Iterable,
|
5
|
-
Optional,
|
6
|
-
)
|
1
|
+
from collections.abc import Callable, Iterable
|
2
|
+
from typing import Any
|
7
3
|
|
8
4
|
from jsonpath_ng.ext import parser
|
9
5
|
|
@@ -16,7 +12,7 @@ from reconcile.utils import gql
|
|
16
12
|
|
17
13
|
|
18
14
|
def get_status_board(
|
19
|
-
query_func:
|
15
|
+
query_func: Callable | None = None,
|
20
16
|
) -> list[StatusBoardV1]:
|
21
17
|
if not query_func:
|
22
18
|
query_func = gql.get_api().query
|
@@ -1,5 +1,4 @@
|
|
1
1
|
from collections.abc import Callable
|
2
|
-
from typing import Optional
|
3
2
|
|
4
3
|
from reconcile.gql_definitions.common.pipeline_providers import (
|
5
4
|
PipelinesProviderTektonV1,
|
@@ -9,7 +8,7 @@ from reconcile.utils import gql
|
|
9
8
|
|
10
9
|
|
11
10
|
def get_tekton_pipeline_providers(
|
12
|
-
query_func:
|
11
|
+
query_func: Callable | None = None,
|
13
12
|
) -> list[PipelinesProviderTektonV1]:
|
14
13
|
if not query_func:
|
15
14
|
query_func = gql.get_api().query
|
@@ -1,5 +1,4 @@
|
|
1
1
|
from collections.abc import Callable
|
2
|
-
from typing import Optional
|
3
2
|
|
4
3
|
from reconcile.gql_definitions.terraform_resources.terraform_resources_namespaces import (
|
5
4
|
NamespaceV1,
|
@@ -8,7 +7,7 @@ from reconcile.gql_definitions.terraform_resources.terraform_resources_namespace
|
|
8
7
|
from reconcile.utils import gql
|
9
8
|
|
10
9
|
|
11
|
-
def get_namespaces(query_func:
|
10
|
+
def get_namespaces(query_func: Callable | None = None) -> list[NamespaceV1]:
|
12
11
|
if not query_func:
|
13
12
|
query_func = gql.get_api().query
|
14
13
|
data = query(query_func=query_func)
|
@@ -1,5 +1,3 @@
|
|
1
|
-
from typing import Optional
|
2
|
-
|
3
1
|
from reconcile.gql_definitions.terraform_tgw_attachments.aws_accounts import (
|
4
2
|
AWSAccountV1,
|
5
3
|
query,
|
@@ -9,7 +7,7 @@ from reconcile.utils.gql import GqlApi
|
|
9
7
|
|
10
8
|
def get_aws_accounts(
|
11
9
|
gql_api: GqlApi,
|
12
|
-
name:
|
10
|
+
name: str | None = None,
|
13
11
|
) -> list[AWSAccountV1]:
|
14
12
|
variables = {
|
15
13
|
"name": name,
|
reconcile/utils/acs/base.py
CHANGED
@@ -2,7 +2,6 @@ import logging
|
|
2
2
|
from collections.abc import Callable
|
3
3
|
from typing import (
|
4
4
|
Any,
|
5
|
-
Optional,
|
6
5
|
Self,
|
7
6
|
)
|
8
7
|
|
@@ -55,7 +54,7 @@ class AcsBaseApi(BaseModel):
|
|
55
54
|
)
|
56
55
|
|
57
56
|
def generic_request(
|
58
|
-
self, path: str, verb: str, json:
|
57
|
+
self, path: str, verb: str, json: Any | None = None
|
59
58
|
) -> requests.Response:
|
60
59
|
url = f"{self.url}{path}"
|
61
60
|
headers = {
|
@@ -77,6 +76,6 @@ class AcsBaseApi(BaseModel):
|
|
77
76
|
return response
|
78
77
|
|
79
78
|
def generic_request_json(
|
80
|
-
self, path: str, verb: str, json:
|
79
|
+
self, path: str, verb: str, json: Any | None = None
|
81
80
|
) -> Any:
|
82
81
|
return self.generic_request(path, verb, json=json).json()
|
reconcile/utils/acs/notifiers.py
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
import json
|
2
|
-
from typing import Any
|
2
|
+
from typing import Any
|
3
3
|
|
4
4
|
from pydantic import BaseModel
|
5
5
|
|
@@ -35,9 +35,9 @@ class JiraNotifier(BaseModel):
|
|
35
35
|
name: str
|
36
36
|
board: str
|
37
37
|
url: str
|
38
|
-
issue_type:
|
38
|
+
issue_type: str | None
|
39
39
|
severity_priority_mappings: list[SeverityPriorityMapping]
|
40
|
-
custom_fields:
|
40
|
+
custom_fields: dict[str, Any] | None
|
41
41
|
|
42
42
|
@staticmethod
|
43
43
|
def from_api(notifier: dict[str, Any]) -> "JiraNotifier":
|