qontract-reconcile 0.10.0__py3-none-any.whl → 0.10.1.dev1203__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.1.dev1203.dist-info/METADATA +500 -0
- qontract_reconcile-0.10.1.dev1203.dist-info/RECORD +771 -0
- {qontract_reconcile-0.10.0.dist-info → qontract_reconcile-0.10.1.dev1203.dist-info}/WHEEL +1 -2
- {qontract_reconcile-0.10.0.dist-info → qontract_reconcile-0.10.1.dev1203.dist-info}/entry_points.txt +4 -2
- reconcile/acs_notifiers.py +126 -0
- reconcile/acs_policies.py +243 -0
- reconcile/acs_rbac.py +596 -0
- reconcile/aus/advanced_upgrade_service.py +621 -8
- reconcile/aus/aus_label_source.py +115 -0
- reconcile/aus/base.py +1053 -353
- reconcile/{utils → aus}/cluster_version_data.py +27 -12
- reconcile/aus/healthchecks.py +77 -0
- reconcile/aus/metrics.py +158 -0
- reconcile/aus/models.py +245 -5
- reconcile/aus/node_pool_spec.py +35 -0
- reconcile/aus/ocm_addons_upgrade_scheduler_org.py +225 -110
- reconcile/aus/ocm_upgrade_scheduler.py +76 -71
- reconcile/aus/ocm_upgrade_scheduler_org.py +81 -23
- reconcile/aus/version_gate_approver.py +204 -0
- reconcile/aus/version_gates/__init__.py +12 -0
- reconcile/aus/version_gates/handler.py +33 -0
- reconcile/aus/version_gates/ingress_gate_handler.py +32 -0
- reconcile/aus/version_gates/ocp_gate_handler.py +26 -0
- reconcile/aus/version_gates/sts_version_gate_handler.py +100 -0
- reconcile/aws_account_manager/README.md +5 -0
- reconcile/aws_account_manager/integration.py +373 -0
- reconcile/aws_account_manager/merge_request_manager.py +114 -0
- reconcile/aws_account_manager/metrics.py +39 -0
- reconcile/aws_account_manager/reconciler.py +403 -0
- reconcile/aws_account_manager/utils.py +41 -0
- reconcile/aws_ami_cleanup/integration.py +273 -0
- reconcile/aws_ami_share.py +18 -14
- reconcile/aws_cloudwatch_log_retention/integration.py +253 -0
- reconcile/aws_iam_keys.py +1 -1
- reconcile/aws_iam_password_reset.py +56 -20
- reconcile/aws_saml_idp/integration.py +204 -0
- reconcile/aws_saml_roles/integration.py +322 -0
- reconcile/aws_support_cases_sos.py +2 -2
- reconcile/aws_version_sync/integration.py +430 -0
- reconcile/aws_version_sync/merge_request_manager/merge_request.py +156 -0
- reconcile/aws_version_sync/merge_request_manager/merge_request_manager.py +160 -0
- reconcile/aws_version_sync/utils.py +64 -0
- reconcile/blackbox_exporter_endpoint_monitoring.py +2 -5
- reconcile/change_owners/README.md +34 -0
- reconcile/change_owners/approver.py +7 -9
- reconcile/change_owners/bundle.py +134 -9
- reconcile/change_owners/change_log_tracking.py +236 -0
- reconcile/change_owners/change_owners.py +204 -194
- reconcile/change_owners/change_types.py +183 -265
- reconcile/change_owners/changes.py +488 -0
- reconcile/change_owners/decision.py +120 -41
- reconcile/change_owners/diff.py +63 -92
- reconcile/change_owners/implicit_ownership.py +19 -16
- reconcile/change_owners/self_service_roles.py +158 -35
- reconcile/change_owners/tester.py +20 -18
- reconcile/checkpoint.py +4 -6
- reconcile/cli.py +1523 -242
- reconcile/closedbox_endpoint_monitoring_base.py +10 -17
- reconcile/cluster_auth_rhidp/integration.py +257 -0
- 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 +6 -9
- reconcile/dashdotdb_base.py +31 -10
- reconcile/dashdotdb_cso.py +3 -6
- reconcile/dashdotdb_dora.py +530 -0
- reconcile/dashdotdb_dvo.py +10 -13
- reconcile/dashdotdb_slo.py +75 -19
- reconcile/database_access_manager.py +753 -0
- reconcile/deadmanssnitch.py +207 -0
- reconcile/dynatrace_token_provider/dependencies.py +69 -0
- reconcile/dynatrace_token_provider/integration.py +656 -0
- reconcile/dynatrace_token_provider/metrics.py +62 -0
- reconcile/dynatrace_token_provider/model.py +14 -0
- reconcile/dynatrace_token_provider/ocm.py +140 -0
- reconcile/dynatrace_token_provider/validate.py +48 -0
- reconcile/endpoints_discovery/integration.py +348 -0
- reconcile/endpoints_discovery/merge_request.py +96 -0
- reconcile/endpoints_discovery/merge_request_manager.py +178 -0
- reconcile/external_resources/aws.py +204 -0
- reconcile/external_resources/factories.py +163 -0
- reconcile/external_resources/integration.py +194 -0
- reconcile/external_resources/integration_secrets_sync.py +47 -0
- reconcile/external_resources/manager.py +405 -0
- reconcile/external_resources/meta.py +17 -0
- reconcile/external_resources/metrics.py +95 -0
- reconcile/external_resources/model.py +350 -0
- reconcile/external_resources/reconciler.py +265 -0
- reconcile/external_resources/secrets_sync.py +465 -0
- reconcile/external_resources/state.py +258 -0
- reconcile/gabi_authorized_users.py +19 -11
- reconcile/gcr_mirror.py +43 -34
- reconcile/github_org.py +4 -6
- reconcile/github_owners.py +1 -1
- reconcile/github_repo_invites.py +2 -5
- reconcile/gitlab_fork_compliance.py +14 -13
- reconcile/gitlab_housekeeping.py +185 -91
- reconcile/gitlab_labeler.py +15 -14
- reconcile/gitlab_members.py +126 -120
- reconcile/gitlab_owners.py +53 -66
- reconcile/gitlab_permissions.py +167 -6
- reconcile/glitchtip/README.md +150 -0
- reconcile/glitchtip/integration.py +99 -51
- reconcile/glitchtip/reconciler.py +99 -70
- reconcile/glitchtip_project_alerts/__init__.py +0 -0
- reconcile/glitchtip_project_alerts/integration.py +333 -0
- reconcile/glitchtip_project_dsn/integration.py +43 -43
- reconcile/gql_definitions/acs/__init__.py +0 -0
- reconcile/gql_definitions/acs/acs_instances.py +83 -0
- reconcile/gql_definitions/acs/acs_policies.py +239 -0
- reconcile/gql_definitions/acs/acs_rbac.py +111 -0
- reconcile/gql_definitions/advanced_upgrade_service/aus_clusters.py +46 -8
- reconcile/gql_definitions/advanced_upgrade_service/aus_organization.py +38 -8
- reconcile/gql_definitions/app_interface_metrics_exporter/__init__.py +0 -0
- reconcile/gql_definitions/app_interface_metrics_exporter/onboarding_status.py +61 -0
- reconcile/gql_definitions/aws_account_manager/__init__.py +0 -0
- reconcile/gql_definitions/aws_account_manager/aws_accounts.py +177 -0
- reconcile/gql_definitions/aws_ami_cleanup/__init__.py +0 -0
- reconcile/gql_definitions/aws_ami_cleanup/aws_accounts.py +161 -0
- reconcile/gql_definitions/aws_saml_idp/__init__.py +0 -0
- reconcile/gql_definitions/aws_saml_idp/aws_accounts.py +117 -0
- reconcile/gql_definitions/aws_saml_roles/__init__.py +0 -0
- reconcile/gql_definitions/aws_saml_roles/aws_accounts.py +117 -0
- reconcile/gql_definitions/aws_saml_roles/roles.py +97 -0
- reconcile/gql_definitions/aws_version_sync/__init__.py +0 -0
- reconcile/gql_definitions/aws_version_sync/clusters.py +83 -0
- reconcile/gql_definitions/aws_version_sync/namespaces.py +143 -0
- reconcile/gql_definitions/change_owners/queries/change_types.py +16 -29
- reconcile/gql_definitions/change_owners/queries/self_service_roles.py +45 -11
- reconcile/gql_definitions/cluster_auth_rhidp/__init__.py +0 -0
- reconcile/gql_definitions/cluster_auth_rhidp/clusters.py +128 -0
- reconcile/gql_definitions/cna/queries/cna_provisioners.py +6 -8
- reconcile/gql_definitions/cna/queries/cna_resources.py +3 -5
- reconcile/gql_definitions/common/alerting_services_settings.py +2 -2
- reconcile/gql_definitions/common/app_code_component_repos.py +9 -5
- reconcile/gql_definitions/{glitchtip/glitchtip_settings.py → common/app_interface_custom_messages.py} +14 -16
- reconcile/gql_definitions/common/app_interface_dms_settings.py +86 -0
- reconcile/gql_definitions/common/app_interface_repo_settings.py +2 -2
- reconcile/gql_definitions/common/app_interface_state_settings.py +3 -5
- reconcile/gql_definitions/common/app_interface_vault_settings.py +3 -5
- reconcile/gql_definitions/common/app_quay_repos_escalation_policies.py +120 -0
- reconcile/gql_definitions/common/apps.py +72 -0
- reconcile/gql_definitions/common/aws_vpc_requests.py +109 -0
- reconcile/gql_definitions/common/aws_vpcs.py +84 -0
- reconcile/gql_definitions/common/clusters.py +120 -254
- reconcile/gql_definitions/common/clusters_minimal.py +11 -35
- reconcile/gql_definitions/common/clusters_with_dms.py +72 -0
- reconcile/gql_definitions/common/clusters_with_peering.py +70 -98
- reconcile/gql_definitions/common/github_orgs.py +2 -2
- reconcile/gql_definitions/common/jira_settings.py +68 -0
- reconcile/gql_definitions/common/jiralert_settings.py +68 -0
- reconcile/gql_definitions/common/namespaces.py +74 -32
- reconcile/gql_definitions/common/namespaces_minimal.py +4 -10
- reconcile/gql_definitions/common/ocm_env_telemeter.py +95 -0
- reconcile/gql_definitions/common/ocm_environments.py +4 -2
- reconcile/gql_definitions/common/pagerduty_instances.py +5 -5
- reconcile/gql_definitions/common/pgp_reencryption_settings.py +5 -11
- reconcile/gql_definitions/common/pipeline_providers.py +45 -90
- reconcile/gql_definitions/common/quay_instances.py +64 -0
- reconcile/gql_definitions/common/quay_orgs.py +68 -0
- reconcile/gql_definitions/common/reserved_networks.py +94 -0
- reconcile/gql_definitions/common/saas_files.py +133 -95
- reconcile/gql_definitions/common/saas_target_namespaces.py +41 -26
- reconcile/gql_definitions/common/saasherder_settings.py +2 -2
- reconcile/gql_definitions/common/slack_workspaces.py +62 -0
- reconcile/gql_definitions/common/smtp_client_settings.py +2 -2
- reconcile/gql_definitions/common/state_aws_account.py +77 -0
- reconcile/gql_definitions/common/users.py +3 -2
- reconcile/gql_definitions/cost_report/__init__.py +0 -0
- reconcile/gql_definitions/cost_report/app_names.py +68 -0
- reconcile/gql_definitions/cost_report/cost_namespaces.py +86 -0
- reconcile/gql_definitions/cost_report/settings.py +77 -0
- reconcile/gql_definitions/dashdotdb_slo/slo_documents_query.py +42 -12
- reconcile/gql_definitions/dynatrace_token_provider/__init__.py +0 -0
- reconcile/gql_definitions/dynatrace_token_provider/dynatrace_bootstrap_tokens.py +79 -0
- reconcile/gql_definitions/dynatrace_token_provider/token_specs.py +84 -0
- reconcile/gql_definitions/endpoints_discovery/__init__.py +0 -0
- reconcile/gql_definitions/endpoints_discovery/namespaces.py +127 -0
- reconcile/gql_definitions/external_resources/__init__.py +0 -0
- reconcile/gql_definitions/external_resources/aws_accounts.py +73 -0
- reconcile/gql_definitions/external_resources/external_resources_modules.py +78 -0
- reconcile/gql_definitions/external_resources/external_resources_namespaces.py +1111 -0
- reconcile/gql_definitions/external_resources/external_resources_settings.py +98 -0
- reconcile/gql_definitions/fragments/aus_organization.py +34 -39
- reconcile/gql_definitions/fragments/aws_account_common.py +62 -0
- reconcile/gql_definitions/fragments/aws_account_managed.py +57 -0
- reconcile/gql_definitions/fragments/aws_account_sso.py +35 -0
- reconcile/gql_definitions/fragments/aws_infra_management_account.py +2 -2
- reconcile/gql_definitions/fragments/aws_vpc.py +47 -0
- reconcile/gql_definitions/fragments/aws_vpc_request.py +65 -0
- reconcile/gql_definitions/fragments/aws_vpc_request_subnet.py +29 -0
- reconcile/gql_definitions/fragments/deplopy_resources.py +7 -7
- reconcile/gql_definitions/fragments/disable.py +28 -0
- reconcile/gql_definitions/fragments/jumphost_common_fields.py +2 -2
- reconcile/gql_definitions/fragments/membership_source.py +47 -0
- reconcile/gql_definitions/fragments/minimal_ocm_organization.py +29 -0
- reconcile/gql_definitions/fragments/oc_connection_cluster.py +4 -9
- reconcile/gql_definitions/fragments/ocm_environment.py +5 -5
- reconcile/gql_definitions/fragments/pipeline_provider_retention.py +30 -0
- reconcile/gql_definitions/fragments/prometheus_instance.py +48 -0
- reconcile/gql_definitions/fragments/resource_limits_requirements.py +29 -0
- reconcile/gql_definitions/fragments/{resource_requirements.py → resource_requests_requirements.py} +3 -3
- reconcile/gql_definitions/fragments/resource_values.py +2 -2
- reconcile/gql_definitions/fragments/saas_target_namespace.py +55 -12
- reconcile/gql_definitions/fragments/serviceaccount_token.py +38 -0
- reconcile/gql_definitions/fragments/terraform_state.py +36 -0
- reconcile/gql_definitions/fragments/upgrade_policy.py +5 -3
- reconcile/gql_definitions/fragments/user.py +3 -2
- reconcile/gql_definitions/fragments/vault_secret.py +2 -2
- reconcile/gql_definitions/gitlab_members/gitlab_instances.py +6 -2
- reconcile/gql_definitions/gitlab_members/permissions.py +3 -5
- reconcile/gql_definitions/glitchtip/glitchtip_instance.py +16 -2
- reconcile/gql_definitions/glitchtip/glitchtip_project.py +22 -23
- reconcile/gql_definitions/glitchtip_project_alerts/__init__.py +0 -0
- reconcile/gql_definitions/glitchtip_project_alerts/glitchtip_project.py +173 -0
- reconcile/gql_definitions/integrations/integrations.py +62 -45
- reconcile/gql_definitions/introspection.json +51176 -0
- reconcile/gql_definitions/jenkins_configs/jenkins_configs.py +13 -5
- reconcile/gql_definitions/jenkins_configs/jenkins_instances.py +79 -0
- reconcile/gql_definitions/jira/__init__.py +0 -0
- reconcile/gql_definitions/jira/jira_servers.py +80 -0
- reconcile/gql_definitions/jira_permissions_validator/__init__.py +0 -0
- reconcile/gql_definitions/jira_permissions_validator/jira_boards_for_permissions_validator.py +131 -0
- reconcile/gql_definitions/jumphosts/jumphosts.py +3 -5
- reconcile/gql_definitions/ldap_groups/__init__.py +0 -0
- reconcile/gql_definitions/ldap_groups/roles.py +111 -0
- reconcile/gql_definitions/ldap_groups/settings.py +79 -0
- reconcile/gql_definitions/maintenance/__init__.py +0 -0
- reconcile/gql_definitions/maintenance/maintenances.py +101 -0
- reconcile/gql_definitions/membershipsources/__init__.py +0 -0
- reconcile/gql_definitions/membershipsources/roles.py +112 -0
- reconcile/gql_definitions/ocm_labels/__init__.py +0 -0
- reconcile/gql_definitions/ocm_labels/clusters.py +112 -0
- reconcile/gql_definitions/ocm_labels/organizations.py +78 -0
- reconcile/gql_definitions/ocm_subscription_labels/__init__.py +0 -0
- reconcile/gql_definitions/openshift_cluster_bots/__init__.py +0 -0
- reconcile/gql_definitions/openshift_cluster_bots/clusters.py +126 -0
- reconcile/gql_definitions/openshift_groups/managed_groups.py +2 -2
- reconcile/gql_definitions/openshift_groups/managed_roles.py +3 -2
- reconcile/gql_definitions/openshift_serviceaccount_tokens/__init__.py +0 -0
- reconcile/gql_definitions/openshift_serviceaccount_tokens/tokens.py +132 -0
- reconcile/gql_definitions/quay_membership/quay_membership.py +3 -5
- reconcile/gql_definitions/rhidp/__init__.py +0 -0
- reconcile/gql_definitions/rhidp/organizations.py +96 -0
- reconcile/gql_definitions/service_dependencies/jenkins_instance_fragment.py +2 -2
- reconcile/gql_definitions/service_dependencies/service_dependencies.py +9 -31
- reconcile/gql_definitions/sharding/aws_accounts.py +2 -2
- reconcile/gql_definitions/sharding/ocm_organization.py +63 -0
- reconcile/gql_definitions/skupper_network/site_controller_template.py +2 -2
- reconcile/gql_definitions/skupper_network/skupper_networks.py +12 -38
- reconcile/gql_definitions/slack_usergroups/clusters.py +2 -2
- reconcile/gql_definitions/slack_usergroups/permissions.py +8 -15
- reconcile/gql_definitions/slack_usergroups/users.py +3 -2
- reconcile/gql_definitions/slo_documents/__init__.py +0 -0
- reconcile/gql_definitions/slo_documents/slo_documents.py +142 -0
- reconcile/gql_definitions/status_board/__init__.py +0 -0
- reconcile/gql_definitions/status_board/status_board.py +163 -0
- reconcile/gql_definitions/statuspage/statuspages.py +56 -7
- reconcile/gql_definitions/templating/__init__.py +0 -0
- reconcile/gql_definitions/templating/template_collection.py +130 -0
- reconcile/gql_definitions/templating/templates.py +108 -0
- reconcile/gql_definitions/terraform_cloudflare_dns/app_interface_cloudflare_dns_settings.py +4 -8
- reconcile/gql_definitions/terraform_cloudflare_dns/terraform_cloudflare_zones.py +8 -8
- reconcile/gql_definitions/terraform_cloudflare_resources/terraform_cloudflare_accounts.py +6 -8
- reconcile/gql_definitions/terraform_cloudflare_resources/terraform_cloudflare_resources.py +45 -56
- reconcile/gql_definitions/terraform_cloudflare_users/app_interface_setting_cloudflare_and_vault.py +4 -8
- reconcile/gql_definitions/terraform_cloudflare_users/terraform_cloudflare_roles.py +4 -8
- reconcile/gql_definitions/terraform_init/__init__.py +0 -0
- reconcile/gql_definitions/terraform_init/aws_accounts.py +93 -0
- reconcile/gql_definitions/terraform_repo/__init__.py +0 -0
- reconcile/gql_definitions/terraform_repo/terraform_repo.py +141 -0
- reconcile/gql_definitions/terraform_resources/database_access_manager.py +158 -0
- reconcile/gql_definitions/terraform_resources/terraform_resources_namespaces.py +153 -162
- reconcile/gql_definitions/terraform_tgw_attachments/__init__.py +0 -0
- reconcile/gql_definitions/terraform_tgw_attachments/aws_accounts.py +119 -0
- reconcile/gql_definitions/unleash_feature_toggles/__init__.py +0 -0
- reconcile/gql_definitions/unleash_feature_toggles/feature_toggles.py +113 -0
- reconcile/gql_definitions/vault_instances/vault_instances.py +17 -50
- reconcile/gql_definitions/vault_policies/vault_policies.py +2 -2
- reconcile/gql_definitions/vpc_peerings_validator/vpc_peerings_validator.py +49 -12
- reconcile/gql_definitions/vpc_peerings_validator/vpc_peerings_validator_peered_cluster_fragment.py +7 -2
- reconcile/integrations_manager.py +25 -13
- reconcile/jenkins/types.py +5 -1
- reconcile/jenkins_base.py +36 -0
- reconcile/jenkins_job_builder.py +10 -48
- reconcile/jenkins_job_builds_cleaner.py +40 -25
- reconcile/jenkins_job_cleaner.py +1 -3
- reconcile/jenkins_roles.py +22 -26
- reconcile/jenkins_webhooks.py +9 -6
- reconcile/jenkins_worker_fleets.py +11 -6
- reconcile/jira_permissions_validator.py +340 -0
- reconcile/jira_watcher.py +3 -5
- reconcile/ldap_groups/__init__.py +0 -0
- reconcile/ldap_groups/integration.py +279 -0
- reconcile/ldap_users.py +3 -0
- reconcile/ocm/types.py +39 -59
- reconcile/ocm_additional_routers.py +0 -1
- reconcile/ocm_addons_upgrade_tests_trigger.py +10 -15
- reconcile/ocm_aws_infrastructure_access.py +30 -32
- reconcile/ocm_clusters.py +217 -130
- reconcile/ocm_external_configuration_labels.py +15 -0
- reconcile/ocm_github_idp.py +1 -1
- reconcile/ocm_groups.py +25 -5
- reconcile/ocm_internal_notifications/__init__.py +0 -0
- reconcile/ocm_internal_notifications/integration.py +119 -0
- reconcile/ocm_labels/__init__.py +0 -0
- reconcile/ocm_labels/integration.py +409 -0
- reconcile/ocm_machine_pools.py +517 -108
- reconcile/ocm_upgrade_scheduler_org_updater.py +15 -11
- reconcile/openshift_base.py +609 -207
- reconcile/openshift_cluster_bots.py +344 -0
- reconcile/openshift_clusterrolebindings.py +15 -15
- reconcile/openshift_groups.py +42 -45
- reconcile/openshift_limitranges.py +1 -0
- reconcile/openshift_namespace_labels.py +22 -28
- reconcile/openshift_namespaces.py +22 -22
- reconcile/openshift_network_policies.py +4 -8
- reconcile/openshift_prometheus_rules.py +43 -0
- reconcile/openshift_resourcequotas.py +2 -16
- reconcile/openshift_resources.py +12 -10
- reconcile/openshift_resources_base.py +304 -328
- reconcile/openshift_rolebindings.py +18 -20
- reconcile/openshift_saas_deploy.py +105 -21
- reconcile/openshift_saas_deploy_change_tester.py +30 -35
- reconcile/openshift_saas_deploy_trigger_base.py +39 -36
- reconcile/openshift_saas_deploy_trigger_cleaner.py +41 -27
- 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_serviceaccount_tokens.py +138 -74
- reconcile/openshift_tekton_resources.py +89 -24
- reconcile/openshift_upgrade_watcher.py +110 -62
- reconcile/openshift_users.py +16 -15
- reconcile/openshift_vault_secrets.py +11 -6
- reconcile/oum/__init__.py +0 -0
- reconcile/oum/base.py +387 -0
- reconcile/oum/labelset.py +55 -0
- reconcile/oum/metrics.py +71 -0
- reconcile/oum/models.py +69 -0
- reconcile/oum/providers.py +59 -0
- reconcile/oum/standalone.py +196 -0
- reconcile/prometheus_rules_tester/integration.py +31 -23
- reconcile/quay_base.py +4 -1
- reconcile/quay_membership.py +1 -2
- reconcile/quay_mirror.py +111 -61
- reconcile/quay_mirror_org.py +34 -21
- reconcile/quay_permissions.py +7 -3
- reconcile/quay_repos.py +24 -32
- reconcile/queries.py +263 -198
- reconcile/query_validator.py +3 -5
- reconcile/resource_scraper.py +3 -4
- reconcile/{template_tester.py → resource_template_tester.py} +3 -3
- reconcile/rhidp/__init__.py +0 -0
- reconcile/rhidp/common.py +214 -0
- reconcile/rhidp/metrics.py +20 -0
- reconcile/rhidp/ocm_oidc_idp/__init__.py +0 -0
- reconcile/rhidp/ocm_oidc_idp/base.py +221 -0
- reconcile/rhidp/ocm_oidc_idp/integration.py +56 -0
- reconcile/rhidp/ocm_oidc_idp/metrics.py +22 -0
- reconcile/rhidp/sso_client/__init__.py +0 -0
- reconcile/rhidp/sso_client/base.py +266 -0
- reconcile/rhidp/sso_client/integration.py +60 -0
- reconcile/rhidp/sso_client/metrics.py +39 -0
- reconcile/run_integration.py +293 -0
- reconcile/saas_auto_promotions_manager/integration.py +69 -24
- reconcile/saas_auto_promotions_manager/merge_request_manager/batcher.py +208 -0
- reconcile/saas_auto_promotions_manager/merge_request_manager/desired_state.py +28 -0
- reconcile/saas_auto_promotions_manager/merge_request_manager/merge_request.py +3 -4
- reconcile/saas_auto_promotions_manager/merge_request_manager/merge_request_manager_v2.py +172 -0
- reconcile/saas_auto_promotions_manager/merge_request_manager/metrics.py +42 -0
- reconcile/saas_auto_promotions_manager/merge_request_manager/mr_parser.py +226 -0
- reconcile/saas_auto_promotions_manager/merge_request_manager/open_merge_requests.py +23 -0
- reconcile/saas_auto_promotions_manager/merge_request_manager/renderer.py +108 -32
- reconcile/saas_auto_promotions_manager/meta.py +4 -0
- reconcile/saas_auto_promotions_manager/publisher.py +32 -4
- reconcile/saas_auto_promotions_manager/s3_exporter.py +77 -0
- reconcile/saas_auto_promotions_manager/subscriber.py +110 -23
- reconcile/saas_auto_promotions_manager/utils/saas_files_inventory.py +48 -41
- reconcile/saas_file_validator.py +16 -6
- reconcile/sendgrid_teammates.py +27 -12
- reconcile/service_dependencies.py +0 -3
- reconcile/signalfx_endpoint_monitoring.py +2 -5
- reconcile/skupper_network/integration.py +10 -11
- reconcile/skupper_network/models.py +3 -5
- reconcile/skupper_network/reconciler.py +28 -35
- reconcile/skupper_network/site_controller.py +8 -8
- reconcile/slack_base.py +4 -7
- reconcile/slack_usergroups.py +249 -171
- reconcile/sql_query.py +324 -171
- reconcile/status.py +0 -1
- reconcile/status_board.py +275 -0
- reconcile/statuspage/__init__.py +0 -5
- reconcile/statuspage/atlassian.py +219 -80
- reconcile/statuspage/integration.py +9 -97
- reconcile/statuspage/integrations/__init__.py +0 -0
- reconcile/statuspage/integrations/components.py +77 -0
- reconcile/statuspage/integrations/maintenances.py +111 -0
- reconcile/statuspage/page.py +107 -72
- reconcile/statuspage/state.py +6 -11
- reconcile/statuspage/status.py +8 -12
- reconcile/templates/rosa-classic-cluster-creation.sh.j2 +60 -0
- reconcile/templates/rosa-hcp-cluster-creation.sh.j2 +61 -0
- reconcile/templating/__init__.py +0 -0
- reconcile/templating/lib/__init__.py +0 -0
- reconcile/templating/lib/merge_request_manager.py +180 -0
- reconcile/templating/lib/model.py +20 -0
- reconcile/templating/lib/rendering.py +191 -0
- reconcile/templating/renderer.py +410 -0
- reconcile/templating/validator.py +153 -0
- reconcile/terraform_aws_route53.py +13 -10
- reconcile/terraform_cloudflare_dns.py +92 -122
- reconcile/terraform_cloudflare_resources.py +15 -13
- reconcile/terraform_cloudflare_users.py +27 -27
- reconcile/terraform_init/__init__.py +0 -0
- reconcile/terraform_init/integration.py +165 -0
- reconcile/terraform_init/merge_request.py +57 -0
- reconcile/terraform_init/merge_request_manager.py +102 -0
- reconcile/terraform_repo.py +403 -0
- reconcile/terraform_resources.py +266 -168
- reconcile/terraform_tgw_attachments.py +417 -167
- reconcile/terraform_users.py +40 -17
- reconcile/terraform_vpc_peerings.py +310 -142
- reconcile/terraform_vpc_resources/__init__.py +0 -0
- reconcile/terraform_vpc_resources/integration.py +220 -0
- reconcile/terraform_vpc_resources/merge_request.py +57 -0
- reconcile/terraform_vpc_resources/merge_request_manager.py +107 -0
- reconcile/typed_queries/alerting_services_settings.py +1 -2
- reconcile/typed_queries/app_interface_custom_messages.py +24 -0
- reconcile/typed_queries/app_interface_deadmanssnitch_settings.py +17 -0
- reconcile/typed_queries/app_interface_metrics_exporter/__init__.py +0 -0
- reconcile/typed_queries/app_interface_metrics_exporter/onboarding_status.py +13 -0
- 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/app_quay_repos_escalation_policies.py +14 -0
- reconcile/typed_queries/apps.py +11 -0
- reconcile/typed_queries/aws_vpc_requests.py +9 -0
- reconcile/typed_queries/aws_vpcs.py +12 -0
- reconcile/typed_queries/cloudflare.py +10 -0
- reconcile/typed_queries/clusters.py +7 -5
- reconcile/typed_queries/clusters_minimal.py +6 -5
- reconcile/typed_queries/clusters_with_dms.py +16 -0
- reconcile/typed_queries/cost_report/__init__.py +0 -0
- reconcile/typed_queries/cost_report/app_names.py +22 -0
- reconcile/typed_queries/cost_report/cost_namespaces.py +43 -0
- reconcile/typed_queries/cost_report/settings.py +15 -0
- reconcile/typed_queries/dynatrace.py +10 -0
- reconcile/typed_queries/dynatrace_environments.py +14 -0
- reconcile/typed_queries/dynatrace_token_provider_token_specs.py +14 -0
- reconcile/typed_queries/external_resources.py +46 -0
- reconcile/typed_queries/get_state_aws_account.py +20 -0
- reconcile/typed_queries/glitchtip.py +10 -0
- reconcile/typed_queries/jenkins.py +25 -0
- reconcile/typed_queries/jira.py +7 -0
- reconcile/typed_queries/jira_settings.py +16 -0
- reconcile/typed_queries/jiralert_settings.py +22 -0
- reconcile/typed_queries/ocm.py +8 -0
- reconcile/typed_queries/pagerduty_instances.py +2 -7
- reconcile/typed_queries/quay.py +23 -0
- reconcile/typed_queries/repos.py +20 -8
- reconcile/typed_queries/reserved_networks.py +12 -0
- reconcile/typed_queries/saas_files.py +221 -167
- reconcile/typed_queries/slack.py +7 -0
- reconcile/typed_queries/slo_documents.py +12 -0
- reconcile/typed_queries/status_board.py +58 -0
- reconcile/typed_queries/tekton_pipeline_providers.py +1 -2
- reconcile/typed_queries/terraform_namespaces.py +1 -2
- reconcile/typed_queries/terraform_tgw_attachments/__init__.py +0 -0
- reconcile/typed_queries/terraform_tgw_attachments/aws_accounts.py +16 -0
- reconcile/typed_queries/unleash.py +10 -0
- reconcile/typed_queries/users.py +11 -0
- reconcile/typed_queries/vault.py +10 -0
- reconcile/unleash_feature_toggles/__init__.py +0 -0
- reconcile/unleash_feature_toggles/integration.py +287 -0
- reconcile/utils/acs/__init__.py +0 -0
- reconcile/utils/acs/base.py +81 -0
- reconcile/utils/acs/notifiers.py +143 -0
- reconcile/utils/acs/policies.py +163 -0
- reconcile/utils/acs/rbac.py +277 -0
- reconcile/utils/aggregated_list.py +11 -9
- reconcile/utils/amtool.py +6 -4
- reconcile/utils/aws_api.py +279 -66
- reconcile/utils/aws_api_typed/__init__.py +0 -0
- reconcile/utils/aws_api_typed/account.py +23 -0
- reconcile/utils/aws_api_typed/api.py +273 -0
- reconcile/utils/aws_api_typed/dynamodb.py +16 -0
- reconcile/utils/aws_api_typed/iam.py +67 -0
- reconcile/utils/aws_api_typed/organization.py +152 -0
- reconcile/utils/aws_api_typed/s3.py +26 -0
- reconcile/utils/aws_api_typed/service_quotas.py +79 -0
- reconcile/utils/aws_api_typed/sts.py +36 -0
- reconcile/utils/aws_api_typed/support.py +79 -0
- reconcile/utils/aws_helper.py +42 -3
- reconcile/utils/batches.py +11 -0
- reconcile/utils/binary.py +7 -9
- reconcile/utils/cloud_resource_best_practice/__init__.py +0 -0
- reconcile/utils/cloud_resource_best_practice/aws_rds.py +66 -0
- reconcile/utils/clusterhealth/__init__.py +0 -0
- reconcile/utils/clusterhealth/providerbase.py +39 -0
- reconcile/utils/clusterhealth/telemeter.py +39 -0
- reconcile/utils/config.py +3 -4
- reconcile/utils/deadmanssnitch_api.py +86 -0
- reconcile/utils/differ.py +205 -0
- reconcile/utils/disabled_integrations.py +4 -6
- reconcile/utils/dynatrace/__init__.py +0 -0
- reconcile/utils/dynatrace/client.py +93 -0
- reconcile/utils/early_exit_cache.py +289 -0
- reconcile/utils/elasticsearch_exceptions.py +5 -0
- reconcile/utils/environ.py +2 -2
- reconcile/utils/exceptions.py +4 -0
- reconcile/utils/expiration.py +4 -8
- reconcile/utils/extended_early_exit.py +210 -0
- reconcile/utils/external_resource_spec.py +34 -12
- reconcile/utils/external_resources.py +48 -20
- reconcile/utils/filtering.py +16 -0
- reconcile/utils/git.py +49 -16
- reconcile/utils/github_api.py +10 -9
- reconcile/utils/gitlab_api.py +333 -190
- reconcile/utils/glitchtip/client.py +97 -100
- reconcile/utils/glitchtip/models.py +89 -11
- reconcile/utils/gql.py +157 -58
- reconcile/utils/grouping.py +17 -0
- reconcile/utils/helm.py +89 -18
- reconcile/utils/helpers.py +51 -0
- reconcile/utils/imap_client.py +5 -6
- reconcile/utils/internal_groups/__init__.py +0 -0
- reconcile/utils/internal_groups/client.py +160 -0
- reconcile/utils/internal_groups/models.py +71 -0
- reconcile/utils/jenkins_api.py +10 -34
- reconcile/utils/jinja2/__init__.py +0 -0
- reconcile/utils/{jinja2_ext.py → jinja2/extensions.py} +6 -4
- reconcile/utils/jinja2/filters.py +142 -0
- reconcile/utils/jinja2/utils.py +278 -0
- reconcile/utils/jira_client.py +165 -8
- reconcile/utils/jjb_client.py +47 -35
- reconcile/utils/jobcontroller/__init__.py +0 -0
- reconcile/utils/jobcontroller/controller.py +413 -0
- reconcile/utils/jobcontroller/models.py +195 -0
- reconcile/utils/jsonpath.py +4 -5
- reconcile/utils/jump_host.py +13 -12
- reconcile/utils/keycloak.py +106 -0
- reconcile/utils/ldap_client.py +35 -6
- reconcile/utils/lean_terraform_client.py +115 -6
- reconcile/utils/membershipsources/__init__.py +0 -0
- reconcile/utils/membershipsources/app_interface_resolver.py +60 -0
- reconcile/utils/membershipsources/models.py +91 -0
- reconcile/utils/membershipsources/resolver.py +110 -0
- reconcile/utils/merge_request_manager/__init__.py +0 -0
- reconcile/utils/merge_request_manager/merge_request_manager.py +99 -0
- reconcile/utils/merge_request_manager/parser.py +67 -0
- reconcile/utils/metrics.py +511 -1
- reconcile/utils/models.py +123 -0
- reconcile/utils/mr/README.md +198 -0
- reconcile/utils/mr/__init__.py +14 -10
- reconcile/utils/mr/app_interface_reporter.py +2 -2
- reconcile/utils/mr/aws_access.py +4 -4
- reconcile/utils/mr/base.py +51 -31
- reconcile/utils/mr/clusters_updates.py +10 -7
- reconcile/utils/mr/glitchtip_access_reporter.py +2 -4
- reconcile/utils/mr/labels.py +14 -1
- reconcile/utils/mr/notificator.py +1 -3
- reconcile/utils/mr/ocm_update_recommended_version.py +1 -2
- reconcile/utils/mr/ocm_upgrade_scheduler_org_updates.py +7 -3
- reconcile/utils/mr/promote_qontract.py +203 -0
- reconcile/utils/mr/user_maintenance.py +24 -4
- reconcile/utils/oauth2_backend_application_session.py +132 -0
- reconcile/utils/oc.py +194 -170
- reconcile/utils/oc_connection_parameters.py +40 -51
- reconcile/utils/oc_filters.py +11 -13
- reconcile/utils/oc_map.py +14 -35
- reconcile/utils/ocm/__init__.py +30 -1
- reconcile/utils/ocm/addons.py +228 -0
- reconcile/utils/ocm/base.py +618 -5
- reconcile/utils/ocm/cluster_groups.py +5 -56
- reconcile/utils/ocm/clusters.py +111 -99
- reconcile/utils/ocm/identity_providers.py +66 -0
- reconcile/utils/ocm/label_sources.py +75 -0
- reconcile/utils/ocm/labels.py +139 -54
- reconcile/utils/ocm/manifests.py +39 -0
- reconcile/utils/ocm/ocm.py +182 -928
- reconcile/utils/ocm/products.py +758 -0
- reconcile/utils/ocm/search_filters.py +20 -28
- reconcile/utils/ocm/service_log.py +32 -79
- reconcile/utils/ocm/sre_capability_labels.py +51 -0
- reconcile/utils/ocm/status_board.py +66 -0
- reconcile/utils/ocm/subscriptions.py +49 -59
- reconcile/utils/ocm/syncsets.py +39 -0
- reconcile/utils/ocm/upgrades.py +181 -0
- reconcile/utils/ocm_base_client.py +71 -36
- reconcile/utils/openshift_resource.py +113 -67
- reconcile/utils/output.py +18 -11
- reconcile/utils/pagerduty_api.py +16 -10
- reconcile/utils/parse_dhms_duration.py +13 -1
- reconcile/utils/prometheus.py +123 -0
- reconcile/utils/promotion_state.py +56 -19
- reconcile/utils/promtool.py +5 -8
- reconcile/utils/quay_api.py +13 -25
- reconcile/utils/raw_github_api.py +3 -5
- reconcile/utils/repo_owners.py +2 -8
- reconcile/utils/rest_api_base.py +126 -0
- reconcile/utils/rosa/__init__.py +0 -0
- reconcile/utils/rosa/rosa_cli.py +310 -0
- reconcile/utils/rosa/session.py +201 -0
- reconcile/utils/ruamel.py +16 -0
- reconcile/utils/runtime/__init__.py +0 -1
- reconcile/utils/runtime/desired_state_diff.py +9 -20
- reconcile/utils/runtime/environment.py +33 -8
- reconcile/utils/runtime/integration.py +28 -12
- reconcile/utils/runtime/meta.py +1 -3
- reconcile/utils/runtime/runner.py +8 -11
- reconcile/utils/runtime/sharding.py +93 -36
- reconcile/utils/saasherder/__init__.py +1 -1
- reconcile/utils/saasherder/interfaces.py +143 -138
- reconcile/utils/saasherder/models.py +201 -43
- reconcile/utils/saasherder/saasherder.py +508 -378
- reconcile/utils/secret_reader.py +22 -27
- reconcile/utils/semver_helper.py +15 -1
- reconcile/utils/slack_api.py +124 -36
- reconcile/utils/smtp_client.py +1 -2
- reconcile/utils/sqs_gateway.py +10 -6
- reconcile/utils/state.py +276 -127
- reconcile/utils/terraform/config_client.py +6 -7
- reconcile/utils/terraform_client.py +284 -125
- reconcile/utils/terrascript/cloudflare_client.py +38 -17
- reconcile/utils/terrascript/cloudflare_resources.py +67 -18
- reconcile/utils/terrascript/models.py +2 -3
- reconcile/utils/terrascript/resources.py +1 -2
- reconcile/utils/terrascript_aws_client.py +1292 -540
- reconcile/utils/three_way_diff_strategy.py +157 -0
- reconcile/utils/unleash/__init__.py +11 -0
- reconcile/utils/{unleash.py → unleash/client.py} +35 -29
- reconcile/utils/unleash/server.py +145 -0
- reconcile/utils/vault.py +42 -32
- reconcile/utils/vaultsecretref.py +2 -4
- reconcile/utils/vcs.py +250 -0
- reconcile/vault_replication.py +38 -31
- reconcile/vpc_peerings_validator.py +82 -13
- tools/app_interface_metrics_exporter.py +70 -0
- tools/app_interface_reporter.py +44 -157
- tools/cli_commands/container_images_report.py +154 -0
- tools/cli_commands/cost_report/__init__.py +0 -0
- tools/cli_commands/cost_report/aws.py +137 -0
- tools/cli_commands/cost_report/cost_management_api.py +155 -0
- tools/cli_commands/cost_report/model.py +49 -0
- tools/cli_commands/cost_report/openshift.py +166 -0
- tools/cli_commands/cost_report/openshift_cost_optimization.py +187 -0
- tools/cli_commands/cost_report/response.py +124 -0
- tools/cli_commands/cost_report/util.py +72 -0
- tools/cli_commands/cost_report/view.py +524 -0
- tools/cli_commands/erv2.py +620 -0
- tools/cli_commands/gpg_encrypt.py +5 -8
- tools/cli_commands/systems_and_tools.py +489 -0
- tools/glitchtip_access_revalidation.py +1 -1
- tools/qontract_cli.py +2301 -673
- tools/saas_metrics_exporter/__init__.py +0 -0
- tools/saas_metrics_exporter/commit_distance/__init__.py +0 -0
- tools/saas_metrics_exporter/commit_distance/channel.py +63 -0
- tools/saas_metrics_exporter/commit_distance/commit_distance.py +103 -0
- tools/saas_metrics_exporter/commit_distance/metrics.py +19 -0
- tools/saas_metrics_exporter/main.py +99 -0
- tools/saas_promotion_state/__init__.py +0 -0
- tools/saas_promotion_state/saas_promotion_state.py +105 -0
- tools/sd_app_sre_alert_report.py +145 -0
- tools/template_validation.py +107 -0
- e2e_tests/cli.py +0 -83
- e2e_tests/create_namespace.py +0 -43
- e2e_tests/dedicated_admin_rolebindings.py +0 -44
- e2e_tests/dedicated_admin_test_base.py +0 -39
- e2e_tests/default_network_policies.py +0 -47
- e2e_tests/default_project_labels.py +0 -52
- e2e_tests/network_policy_test_base.py +0 -17
- e2e_tests/test_base.py +0 -56
- qontract_reconcile-0.10.0.dist-info/LICENSE +0 -201
- qontract_reconcile-0.10.0.dist-info/METADATA +0 -63
- qontract_reconcile-0.10.0.dist-info/RECORD +0 -586
- qontract_reconcile-0.10.0.dist-info/top_level.txt +0 -4
- reconcile/ecr_mirror.py +0 -152
- reconcile/github_scanner.py +0 -74
- reconcile/gitlab_integrations.py +0 -63
- reconcile/gql_definitions/ocm_oidc_idp/clusters.py +0 -195
- reconcile/gql_definitions/ocp_release_mirror/ocp_release_mirror.py +0 -287
- reconcile/integrations_validator.py +0 -18
- reconcile/jenkins_plugins.py +0 -129
- reconcile/kafka_clusters.py +0 -208
- reconcile/ocm_cluster_admin.py +0 -42
- reconcile/ocm_oidc_idp.py +0 -198
- reconcile/ocp_release_mirror.py +0 -373
- reconcile/prometheus_rules_tester_old.py +0 -436
- reconcile/saas_auto_promotions_manager/merge_request_manager/merge_request_manager.py +0 -279
- reconcile/saas_auto_promotions_manager/utils/vcs.py +0 -141
- reconcile/sentry_config.py +0 -613
- reconcile/sentry_helper.py +0 -69
- reconcile/test/conftest.py +0 -187
- reconcile/test/fixtures.py +0 -24
- reconcile/test/saas_auto_promotions_manager/conftest.py +0 -69
- reconcile/test/saas_auto_promotions_manager/merge_request_manager/merge_request_manager/conftest.py +0 -110
- reconcile/test/saas_auto_promotions_manager/merge_request_manager/merge_request_manager/data_keys.py +0 -10
- reconcile/test/saas_auto_promotions_manager/merge_request_manager/merge_request_manager/test_housekeeping.py +0 -200
- reconcile/test/saas_auto_promotions_manager/merge_request_manager/merge_request_manager/test_merge_request_manager.py +0 -151
- reconcile/test/saas_auto_promotions_manager/merge_request_manager/renderer/conftest.py +0 -63
- reconcile/test/saas_auto_promotions_manager/merge_request_manager/renderer/data_keys.py +0 -4
- reconcile/test/saas_auto_promotions_manager/merge_request_manager/renderer/test_content_multiple_namespaces.py +0 -46
- reconcile/test/saas_auto_promotions_manager/merge_request_manager/renderer/test_content_single_namespace.py +0 -94
- reconcile/test/saas_auto_promotions_manager/merge_request_manager/renderer/test_content_single_target.py +0 -44
- reconcile/test/saas_auto_promotions_manager/subscriber/conftest.py +0 -74
- reconcile/test/saas_auto_promotions_manager/subscriber/data_keys.py +0 -11
- reconcile/test/saas_auto_promotions_manager/subscriber/test_content_hash.py +0 -155
- reconcile/test/saas_auto_promotions_manager/subscriber/test_diff.py +0 -173
- reconcile/test/saas_auto_promotions_manager/subscriber/test_multiple_channels_config_hash.py +0 -226
- reconcile/test/saas_auto_promotions_manager/subscriber/test_multiple_channels_moving_ref.py +0 -224
- reconcile/test/saas_auto_promotions_manager/subscriber/test_single_channel_with_single_publisher.py +0 -350
- reconcile/test/saas_auto_promotions_manager/test_integration_test.py +0 -129
- reconcile/test/saas_auto_promotions_manager/utils/saas_files_inventory/test_multiple_publishers_for_single_channel.py +0 -70
- reconcile/test/saas_auto_promotions_manager/utils/saas_files_inventory/test_saas_files_use_target_config_hash.py +0 -63
- reconcile/test/saas_auto_promotions_manager/utils/saas_files_inventory/test_saas_files_with_auto_promote.py +0 -74
- reconcile/test/saas_auto_promotions_manager/utils/saas_files_inventory/test_saas_files_without_auto_promote.py +0 -65
- reconcile/test/test_aggregated_list.py +0 -237
- reconcile/test/test_amtool.py +0 -37
- reconcile/test/test_auto_promoter.py +0 -295
- reconcile/test/test_aws_ami_share.py +0 -68
- reconcile/test/test_aws_iam_keys.py +0 -70
- reconcile/test/test_aws_iam_password_reset.py +0 -35
- reconcile/test/test_aws_support_cases_sos.py +0 -23
- reconcile/test/test_checkpoint.py +0 -178
- reconcile/test/test_cli.py +0 -41
- reconcile/test/test_closedbox_endpoint_monitoring.py +0 -207
- reconcile/test/test_gabi_authorized_users.py +0 -72
- reconcile/test/test_github_org.py +0 -154
- reconcile/test/test_github_repo_invites.py +0 -123
- reconcile/test/test_gitlab_housekeeping.py +0 -88
- reconcile/test/test_gitlab_labeler.py +0 -129
- reconcile/test/test_gitlab_members.py +0 -283
- reconcile/test/test_instrumented_wrappers.py +0 -18
- reconcile/test/test_integrations_manager.py +0 -995
- reconcile/test/test_jenkins_worker_fleets.py +0 -55
- reconcile/test/test_jump_host.py +0 -117
- reconcile/test/test_ldap_users.py +0 -123
- reconcile/test/test_make.py +0 -28
- reconcile/test/test_ocm_additional_routers.py +0 -134
- reconcile/test/test_ocm_addons_upgrade_scheduler_org.py +0 -149
- reconcile/test/test_ocm_clusters.py +0 -598
- reconcile/test/test_ocm_clusters_manifest_updates.py +0 -89
- reconcile/test/test_ocm_oidc_idp.py +0 -315
- reconcile/test/test_ocm_update_recommended_version.py +0 -145
- reconcile/test/test_ocm_upgrade_scheduler.py +0 -614
- reconcile/test/test_ocm_upgrade_scheduler_org_updater.py +0 -129
- reconcile/test/test_openshift_base.py +0 -730
- reconcile/test/test_openshift_namespace_labels.py +0 -345
- reconcile/test/test_openshift_namespaces.py +0 -256
- reconcile/test/test_openshift_resource.py +0 -415
- reconcile/test/test_openshift_resources_base.py +0 -440
- reconcile/test/test_openshift_saas_deploy_change_tester.py +0 -310
- reconcile/test/test_openshift_tekton_resources.py +0 -253
- reconcile/test/test_openshift_upgrade_watcher.py +0 -146
- reconcile/test/test_prometheus_rules_tester.py +0 -151
- reconcile/test/test_prometheus_rules_tester_old.py +0 -77
- reconcile/test/test_quay_membership.py +0 -86
- reconcile/test/test_quay_mirror.py +0 -109
- reconcile/test/test_quay_mirror_org.py +0 -70
- reconcile/test/test_quay_repos.py +0 -59
- reconcile/test/test_queries.py +0 -53
- reconcile/test/test_repo_owners.py +0 -47
- reconcile/test/test_requests_sender.py +0 -139
- reconcile/test/test_saasherder.py +0 -1074
- reconcile/test/test_saasherder_allowed_secret_paths.py +0 -127
- reconcile/test/test_secret_reader.py +0 -153
- reconcile/test/test_slack_base.py +0 -185
- reconcile/test/test_slack_usergroups.py +0 -744
- reconcile/test/test_sql_query.py +0 -19
- reconcile/test/test_terraform_cloudflare_dns.py +0 -117
- reconcile/test/test_terraform_cloudflare_resources.py +0 -106
- reconcile/test/test_terraform_cloudflare_users.py +0 -749
- reconcile/test/test_terraform_resources.py +0 -257
- reconcile/test/test_terraform_tgw_attachments.py +0 -631
- reconcile/test/test_terraform_users.py +0 -57
- reconcile/test/test_terraform_vpc_peerings.py +0 -499
- reconcile/test/test_terraform_vpc_peerings_build_desired_state.py +0 -1061
- reconcile/test/test_unleash.py +0 -138
- reconcile/test/test_utils_aws_api.py +0 -240
- reconcile/test/test_utils_aws_helper.py +0 -80
- reconcile/test/test_utils_cluster_version_data.py +0 -177
- reconcile/test/test_utils_data_structures.py +0 -13
- reconcile/test/test_utils_disabled_integrations.py +0 -86
- reconcile/test/test_utils_expiration.py +0 -109
- reconcile/test/test_utils_external_resource_spec.py +0 -383
- reconcile/test/test_utils_external_resources.py +0 -247
- reconcile/test/test_utils_github_api.py +0 -73
- reconcile/test/test_utils_gitlab_api.py +0 -20
- reconcile/test/test_utils_gpg.py +0 -69
- reconcile/test/test_utils_gql.py +0 -81
- reconcile/test/test_utils_helm.py +0 -306
- reconcile/test/test_utils_helpers.py +0 -55
- reconcile/test/test_utils_imap_client.py +0 -65
- reconcile/test/test_utils_jjb_client.py +0 -52
- reconcile/test/test_utils_jsonpath.py +0 -286
- reconcile/test/test_utils_ldap_client.py +0 -51
- reconcile/test/test_utils_mr.py +0 -226
- reconcile/test/test_utils_mr_clusters_updates.py +0 -77
- reconcile/test/test_utils_oc.py +0 -984
- reconcile/test/test_utils_ocm.py +0 -110
- reconcile/test/test_utils_pagerduty_api.py +0 -251
- reconcile/test/test_utils_parse_dhms_duration.py +0 -34
- reconcile/test/test_utils_password_validator.py +0 -155
- reconcile/test/test_utils_quay_api.py +0 -86
- reconcile/test/test_utils_semver_helper.py +0 -19
- reconcile/test/test_utils_sharding.py +0 -56
- reconcile/test/test_utils_slack_api.py +0 -439
- reconcile/test/test_utils_smtp_client.py +0 -73
- reconcile/test/test_utils_state.py +0 -256
- reconcile/test/test_utils_terraform.py +0 -13
- reconcile/test/test_utils_terraform_client.py +0 -585
- reconcile/test/test_utils_terraform_config_client.py +0 -219
- reconcile/test/test_utils_terrascript_aws_client.py +0 -277
- reconcile/test/test_utils_terrascript_cloudflare_client.py +0 -597
- reconcile/test/test_utils_terrascript_cloudflare_resources.py +0 -26
- reconcile/test/test_vault_replication.py +0 -515
- reconcile/test/test_vault_utils.py +0 -47
- reconcile/test/test_version_bump.py +0 -18
- reconcile/test/test_vpc_peerings_validator.py +0 -103
- reconcile/test/test_wrong_region.py +0 -78
- reconcile/typed_queries/glitchtip_settings.py +0 -18
- reconcile/typed_queries/ocp_release_mirror.py +0 -11
- reconcile/unleash_watcher.py +0 -120
- reconcile/utils/git_secrets.py +0 -63
- reconcile/utils/mr/auto_promoter.py +0 -218
- reconcile/utils/sentry_client.py +0 -383
- release/test_version.py +0 -50
- release/version.py +0 -100
- tools/test/test_qontract_cli.py +0 -60
- tools/test/test_sre_checkpoints.py +0 -79
- /e2e_tests/__init__.py → /reconcile/aus/upgrades.py +0 -0
- /reconcile/{gql_definitions/ocp_release_mirror → aws_account_manager}/__init__.py +0 -0
- /reconcile/{test → aws_ami_cleanup}/__init__.py +0 -0
- /reconcile/{test/saas_auto_promotions_manager → aws_cloudwatch_log_retention}/__init__.py +0 -0
- /reconcile/{test/saas_auto_promotions_manager/merge_request_manager → aws_saml_idp}/__init__.py +0 -0
- /reconcile/{test/saas_auto_promotions_manager/merge_request_manager/merge_request_manager → aws_saml_roles}/__init__.py +0 -0
- /reconcile/{test/saas_auto_promotions_manager/merge_request_manager/renderer → aws_version_sync}/__init__.py +0 -0
- /reconcile/{test/saas_auto_promotions_manager/subscriber → aws_version_sync/merge_request_manager}/__init__.py +0 -0
- /reconcile/{test/saas_auto_promotions_manager/utils → cluster_auth_rhidp}/__init__.py +0 -0
- /reconcile/{test/saas_auto_promotions_manager/utils/saas_files_inventory → dynatrace_token_provider}/__init__.py +0 -0
- {release → reconcile/endpoints_discovery}/__init__.py +0 -0
- {tools/test → reconcile/external_resources}/__init__.py +0 -0
@@ -1,995 +0,0 @@
|
|
1
|
-
import copy
|
2
|
-
import os
|
3
|
-
from collections.abc import (
|
4
|
-
Callable,
|
5
|
-
Iterable,
|
6
|
-
)
|
7
|
-
from typing import Any
|
8
|
-
|
9
|
-
import pytest
|
10
|
-
|
11
|
-
import reconcile.integrations_manager as intop
|
12
|
-
from reconcile.gql_definitions.common.clusters_minimal import ClusterV1
|
13
|
-
from reconcile.gql_definitions.fragments.deplopy_resources import DeployResourcesFields
|
14
|
-
from reconcile.gql_definitions.fragments.vault_secret import VaultSecret
|
15
|
-
from reconcile.gql_definitions.integrations.integrations import (
|
16
|
-
AWSAccountShardSpecOverrideV1,
|
17
|
-
EnvironmentV1,
|
18
|
-
IntegrationSpecV1,
|
19
|
-
IntegrationV1,
|
20
|
-
OpenshiftClusterShardSpecOverrideV1,
|
21
|
-
OpenshiftClusterShardSpecOverrideV1_ClusterV1,
|
22
|
-
StaticSubShardingV1,
|
23
|
-
)
|
24
|
-
from reconcile.gql_definitions.sharding import aws_accounts as sharding_aws_accounts
|
25
|
-
from reconcile.gql_definitions.terraform_cloudflare_dns.terraform_cloudflare_zones import (
|
26
|
-
AWSAccountV1 as AWSAccountV1_CloudFlare,
|
27
|
-
)
|
28
|
-
from reconcile.gql_definitions.terraform_cloudflare_dns.terraform_cloudflare_zones import (
|
29
|
-
CloudflareAccountV1,
|
30
|
-
CloudflareDnsRecordV1,
|
31
|
-
CloudflareDnsZoneV1,
|
32
|
-
)
|
33
|
-
from reconcile.integrations_manager import HelmIntegrationSpec
|
34
|
-
from reconcile.utils.openshift_resource import ResourceInventory
|
35
|
-
from reconcile.utils.runtime.meta import IntegrationMeta
|
36
|
-
from reconcile.utils.runtime.sharding import (
|
37
|
-
AWSAccountShardingStrategy,
|
38
|
-
AWSAccountShardingV1,
|
39
|
-
CloudflareDnsZoneShardingStrategy,
|
40
|
-
CloudflareDNSZoneShardingV1,
|
41
|
-
IntegrationShardManager,
|
42
|
-
OpenshiftClusterShardingStrategy,
|
43
|
-
OpenshiftClusterShardingV1,
|
44
|
-
ShardSpec,
|
45
|
-
StaticShardingStrategy,
|
46
|
-
StaticShardingV1,
|
47
|
-
)
|
48
|
-
|
49
|
-
AWS_INTEGRATION = "aws_integration"
|
50
|
-
CLOUDFLARE_INTEGRATION = "cloudflare_integration"
|
51
|
-
OPENSHIFT_INTEGRATION = "openshift_integration"
|
52
|
-
|
53
|
-
|
54
|
-
def test_collect_parameters():
|
55
|
-
template = {
|
56
|
-
"parameters": [
|
57
|
-
{
|
58
|
-
"name": "tplt_param",
|
59
|
-
"value": "default",
|
60
|
-
}
|
61
|
-
]
|
62
|
-
}
|
63
|
-
os.environ["tplt_param"] = "override"
|
64
|
-
environment = EnvironmentV1(name="e", parameters='{"env_param": "test"}')
|
65
|
-
|
66
|
-
parameters = intop.collect_parameters(template, environment, "", "", None)
|
67
|
-
expected = {
|
68
|
-
"env_param": "test",
|
69
|
-
"tplt_param": "override",
|
70
|
-
}
|
71
|
-
assert parameters == expected
|
72
|
-
|
73
|
-
|
74
|
-
def test_collect_parameters_env_stronger():
|
75
|
-
template = {
|
76
|
-
"parameters": [
|
77
|
-
{
|
78
|
-
"name": "env_param",
|
79
|
-
"value": "default",
|
80
|
-
}
|
81
|
-
]
|
82
|
-
}
|
83
|
-
environment = EnvironmentV1(name="env", parameters='{"env_param": "override"}')
|
84
|
-
parameters = intop.collect_parameters(template, environment, "", "", None)
|
85
|
-
expected = {
|
86
|
-
"env_param": "override",
|
87
|
-
}
|
88
|
-
assert parameters == expected
|
89
|
-
|
90
|
-
|
91
|
-
def test_collect_parameters_os_env_strongest():
|
92
|
-
template = {
|
93
|
-
"parameters": [
|
94
|
-
{
|
95
|
-
"name": "env_param",
|
96
|
-
"value": "default",
|
97
|
-
}
|
98
|
-
]
|
99
|
-
}
|
100
|
-
os.environ["env_param"] = "strongest"
|
101
|
-
environment = EnvironmentV1(name="env", parameters='{"env_param": "override"}')
|
102
|
-
parameters = intop.collect_parameters(template, environment, "", "", None)
|
103
|
-
expected = {
|
104
|
-
"env_param": "strongest",
|
105
|
-
}
|
106
|
-
assert parameters == expected
|
107
|
-
|
108
|
-
|
109
|
-
def test_collect_parameters_image_tag_from_ref(mocker):
|
110
|
-
template = {
|
111
|
-
"parameters": [
|
112
|
-
{
|
113
|
-
"name": "IMAGE_TAG",
|
114
|
-
"value": "dummy",
|
115
|
-
}
|
116
|
-
]
|
117
|
-
}
|
118
|
-
os.environ["IMAGE_TAG"] = "override"
|
119
|
-
environment = EnvironmentV1(name="env", parameters='{"IMAGE_TAG": "default"}')
|
120
|
-
image_tag_from_ref = {"env": "f44e417"}
|
121
|
-
mocker.patch(
|
122
|
-
"reconcile.integrations_manager.get_image_tag_from_ref", return_value="f44e417"
|
123
|
-
)
|
124
|
-
parameters = intop.collect_parameters(
|
125
|
-
template, environment, "", "", image_tag_from_ref
|
126
|
-
)
|
127
|
-
expected = {
|
128
|
-
"IMAGE_TAG": "f44e417",
|
129
|
-
}
|
130
|
-
assert parameters == expected
|
131
|
-
|
132
|
-
|
133
|
-
@pytest.fixture
|
134
|
-
def resources() -> dict[str, Any]:
|
135
|
-
return {
|
136
|
-
"requests": {
|
137
|
-
"cpu": "100m",
|
138
|
-
"memory": "1Mi",
|
139
|
-
},
|
140
|
-
"limits": {
|
141
|
-
"cpu": "100m",
|
142
|
-
"memory": "1Mi",
|
143
|
-
},
|
144
|
-
}
|
145
|
-
|
146
|
-
|
147
|
-
@pytest.fixture
|
148
|
-
def resources_2() -> dict[str, Any]:
|
149
|
-
return {
|
150
|
-
"requests": {
|
151
|
-
"cpu": "200m",
|
152
|
-
"memory": "2Mi",
|
153
|
-
},
|
154
|
-
"limits": {
|
155
|
-
"cpu": "200m",
|
156
|
-
"memory": "2Mi",
|
157
|
-
},
|
158
|
-
}
|
159
|
-
|
160
|
-
|
161
|
-
@pytest.fixture
|
162
|
-
def basic_integration_spec(
|
163
|
-
gql_class_factory: Callable[..., IntegrationSpecV1], resources: dict[str, Any]
|
164
|
-
) -> IntegrationSpecV1:
|
165
|
-
return gql_class_factory(
|
166
|
-
IntegrationSpecV1, {"extraArgs": "integ-extra-arg", "resources": resources}
|
167
|
-
)
|
168
|
-
|
169
|
-
|
170
|
-
@pytest.fixture
|
171
|
-
def basic_integration(
|
172
|
-
gql_class_factory: Callable[..., IntegrationV1],
|
173
|
-
basic_integration_spec: IntegrationSpecV1,
|
174
|
-
) -> IntegrationV1:
|
175
|
-
return gql_class_factory(
|
176
|
-
IntegrationV1,
|
177
|
-
{
|
178
|
-
"name": "basic-integration",
|
179
|
-
"managed": [
|
180
|
-
{
|
181
|
-
"namespace": {
|
182
|
-
"path": "path",
|
183
|
-
"name": "ns",
|
184
|
-
"cluster": {"name": "cluster"},
|
185
|
-
"environment": {"name": "test"},
|
186
|
-
},
|
187
|
-
"spec": basic_integration_spec.dict(
|
188
|
-
exclude_none=True, by_alias=True
|
189
|
-
),
|
190
|
-
"sharding": None,
|
191
|
-
}
|
192
|
-
],
|
193
|
-
},
|
194
|
-
)
|
195
|
-
|
196
|
-
|
197
|
-
@pytest.fixture
|
198
|
-
def helm_integration_spec(
|
199
|
-
basic_integration_spec: IntegrationSpecV1,
|
200
|
-
) -> HelmIntegrationSpec:
|
201
|
-
|
202
|
-
return HelmIntegrationSpec(
|
203
|
-
**basic_integration_spec.dict(by_alias=True), name="basic-integration"
|
204
|
-
)
|
205
|
-
|
206
|
-
|
207
|
-
def test_build_helm_values_empty():
|
208
|
-
integrations_specs: list[HelmIntegrationSpec] = []
|
209
|
-
expected: dict[str, list] = {
|
210
|
-
"integrations": [],
|
211
|
-
"cronjobs": [],
|
212
|
-
}
|
213
|
-
values = intop.build_helm_values(integrations_specs)
|
214
|
-
assert values.dict(exclude_none=True) == expected
|
215
|
-
|
216
|
-
|
217
|
-
def test_build_helm_values(
|
218
|
-
helm_integration_spec: HelmIntegrationSpec, resources: dict[str, Any]
|
219
|
-
):
|
220
|
-
his1 = helm_integration_spec
|
221
|
-
his2 = copy.deepcopy(his1)
|
222
|
-
|
223
|
-
his2.name = "cron1"
|
224
|
-
his2.cron = "yup"
|
225
|
-
|
226
|
-
integrations_specs: list[HelmIntegrationSpec] = [his1, his2]
|
227
|
-
expected = {
|
228
|
-
"integrations": [
|
229
|
-
{
|
230
|
-
"name": "basic-integration",
|
231
|
-
"extra_args": "integ-extra-arg",
|
232
|
-
"resources": resources,
|
233
|
-
"shard_specs": [],
|
234
|
-
},
|
235
|
-
],
|
236
|
-
"cronjobs": [
|
237
|
-
{
|
238
|
-
"name": "cron1",
|
239
|
-
"cron": "yup",
|
240
|
-
"extra_args": "integ-extra-arg",
|
241
|
-
"resources": resources,
|
242
|
-
"shard_specs": [],
|
243
|
-
},
|
244
|
-
],
|
245
|
-
}
|
246
|
-
values = intop.build_helm_values(integrations_specs)
|
247
|
-
assert values.dict(exclude_none=True) == expected
|
248
|
-
|
249
|
-
|
250
|
-
# Per-AWS-account Tests
|
251
|
-
@pytest.fixture
|
252
|
-
def aws_accounts(
|
253
|
-
gql_class_factory: Callable[..., sharding_aws_accounts.AWSAccountV1]
|
254
|
-
) -> list[sharding_aws_accounts.AWSAccountV1]:
|
255
|
-
|
256
|
-
a1 = gql_class_factory(sharding_aws_accounts.AWSAccountV1, {"name": "acc-1"})
|
257
|
-
a2 = gql_class_factory(
|
258
|
-
sharding_aws_accounts.AWSAccountV1,
|
259
|
-
{"name": "acc-2", "disable": {"integrations": None}},
|
260
|
-
)
|
261
|
-
a3 = gql_class_factory(
|
262
|
-
sharding_aws_accounts.AWSAccountV1,
|
263
|
-
{"name": "acc-3", "disable": {"integrations": []}},
|
264
|
-
)
|
265
|
-
a4 = gql_class_factory(
|
266
|
-
sharding_aws_accounts.AWSAccountV1,
|
267
|
-
{"name": "acc-4", "disable": {"integrations": [AWS_INTEGRATION]}},
|
268
|
-
)
|
269
|
-
return [a1, a2, a3, a4]
|
270
|
-
|
271
|
-
|
272
|
-
@pytest.fixture
|
273
|
-
def aws_account_sharding_strategy(
|
274
|
-
aws_accounts: list[sharding_aws_accounts.AWSAccountV1],
|
275
|
-
) -> AWSAccountShardingStrategy:
|
276
|
-
return AWSAccountShardingStrategy(aws_accounts)
|
277
|
-
|
278
|
-
|
279
|
-
@pytest.fixture
|
280
|
-
def cloudflare_records():
|
281
|
-
return [
|
282
|
-
CloudflareDnsRecordV1(
|
283
|
-
identifier="id",
|
284
|
-
name="subdomain",
|
285
|
-
type="CNAME",
|
286
|
-
ttl=10,
|
287
|
-
value="foo.com",
|
288
|
-
priority=None,
|
289
|
-
data=None,
|
290
|
-
proxied=None,
|
291
|
-
)
|
292
|
-
]
|
293
|
-
|
294
|
-
|
295
|
-
@pytest.fixture
|
296
|
-
def aws_account_for_cloudflare():
|
297
|
-
return AWSAccountV1_CloudFlare(
|
298
|
-
name="foo",
|
299
|
-
consoleUrl="url",
|
300
|
-
terraformUsername="bar",
|
301
|
-
automationToken=VaultSecret(path="foo", field="bar", format=None, version=None),
|
302
|
-
terraformState=None,
|
303
|
-
)
|
304
|
-
|
305
|
-
|
306
|
-
@pytest.fixture
|
307
|
-
def cloudflare_account(aws_account_for_cloudflare):
|
308
|
-
return CloudflareAccountV1(
|
309
|
-
name="fakeaccount",
|
310
|
-
type="free",
|
311
|
-
description="description",
|
312
|
-
providerVersion="0.0",
|
313
|
-
enforceTwofactor=False,
|
314
|
-
apiCredentials=VaultSecret(
|
315
|
-
path="foo/bar", field="foo", format="bar", version=2
|
316
|
-
),
|
317
|
-
terraformStateAccount=aws_account_for_cloudflare,
|
318
|
-
deletionApprovals=None,
|
319
|
-
)
|
320
|
-
|
321
|
-
|
322
|
-
@pytest.fixture
|
323
|
-
def cloudflare_dns_zones(cloudflare_account, cloudflare_records):
|
324
|
-
return [
|
325
|
-
CloudflareDnsZoneV1(
|
326
|
-
identifier="zone1",
|
327
|
-
zone="fakezone1.com",
|
328
|
-
account=cloudflare_account,
|
329
|
-
records=cloudflare_records,
|
330
|
-
type="full",
|
331
|
-
plan="free",
|
332
|
-
delete=False,
|
333
|
-
max_records=None,
|
334
|
-
),
|
335
|
-
CloudflareDnsZoneV1(
|
336
|
-
identifier="zone2",
|
337
|
-
zone="fakezone2.com",
|
338
|
-
account=cloudflare_account,
|
339
|
-
records=cloudflare_records,
|
340
|
-
type="full",
|
341
|
-
plan="free",
|
342
|
-
delete=False,
|
343
|
-
max_records=None,
|
344
|
-
),
|
345
|
-
]
|
346
|
-
|
347
|
-
|
348
|
-
@pytest.fixture
|
349
|
-
def cloudflare_zone_sharding_strategy(
|
350
|
-
cloudflare_dns_zones: list[CloudflareDnsZoneV1],
|
351
|
-
) -> CloudflareDnsZoneShardingStrategy:
|
352
|
-
return CloudflareDnsZoneShardingStrategy(cloudflare_dns_zones)
|
353
|
-
|
354
|
-
|
355
|
-
@pytest.fixture
|
356
|
-
def openshift_clusters(gql_class_factory: Callable[..., ClusterV1]) -> list[ClusterV1]:
|
357
|
-
return [
|
358
|
-
gql_class_factory(
|
359
|
-
ClusterV1,
|
360
|
-
{"name": "cluster-1", "auth": [{"service": "github-org", "org": "redhat"}]},
|
361
|
-
),
|
362
|
-
gql_class_factory(
|
363
|
-
ClusterV1,
|
364
|
-
{"name": "cluster-2", "auth": [{"service": "github-org", "org": "redhat"}]},
|
365
|
-
),
|
366
|
-
]
|
367
|
-
|
368
|
-
|
369
|
-
@pytest.fixture
|
370
|
-
def openshift_cluster_sharding_strategy(
|
371
|
-
openshift_clusters: list[ClusterV1],
|
372
|
-
) -> OpenshiftClusterShardingStrategy:
|
373
|
-
return OpenshiftClusterShardingStrategy(openshift_clusters)
|
374
|
-
|
375
|
-
|
376
|
-
@pytest.fixture
|
377
|
-
def shard_manager(
|
378
|
-
aws_account_sharding_strategy: AWSAccountShardingStrategy,
|
379
|
-
cloudflare_zone_sharding_strategy: CloudflareDnsZoneShardingStrategy,
|
380
|
-
openshift_cluster_sharding_strategy: OpenshiftClusterShardingStrategy,
|
381
|
-
) -> IntegrationShardManager:
|
382
|
-
|
383
|
-
return IntegrationShardManager(
|
384
|
-
strategies={
|
385
|
-
StaticShardingStrategy.IDENTIFIER: StaticShardingStrategy(),
|
386
|
-
aws_account_sharding_strategy.IDENTIFIER: aws_account_sharding_strategy,
|
387
|
-
openshift_cluster_sharding_strategy.IDENTIFIER: openshift_cluster_sharding_strategy,
|
388
|
-
cloudflare_zone_sharding_strategy.IDENTIFIER: cloudflare_zone_sharding_strategy,
|
389
|
-
},
|
390
|
-
integration_runtime_meta={
|
391
|
-
"basic-integration": IntegrationMeta(
|
392
|
-
name="basic-integration",
|
393
|
-
short_help="",
|
394
|
-
args=["--arg"],
|
395
|
-
),
|
396
|
-
AWS_INTEGRATION: IntegrationMeta(
|
397
|
-
name=AWS_INTEGRATION, short_help="", args=["--account-name"]
|
398
|
-
),
|
399
|
-
CLOUDFLARE_INTEGRATION: IntegrationMeta(
|
400
|
-
name=CLOUDFLARE_INTEGRATION, short_help="", args=["--zone-name"]
|
401
|
-
),
|
402
|
-
OPENSHIFT_INTEGRATION: IntegrationMeta(
|
403
|
-
name=OPENSHIFT_INTEGRATION,
|
404
|
-
short_help="",
|
405
|
-
args=["--arg", "--cluster-name"],
|
406
|
-
),
|
407
|
-
},
|
408
|
-
)
|
409
|
-
|
410
|
-
|
411
|
-
def test_shard_manager_aws_account_filtering(
|
412
|
-
aws_account_sharding_strategy: AWSAccountShardingStrategy,
|
413
|
-
):
|
414
|
-
assert ["acc-1", "acc-2", "acc-3", "acc-4"] == [
|
415
|
-
a.name
|
416
|
-
for a in aws_account_sharding_strategy.filter_objects("another-integration")
|
417
|
-
]
|
418
|
-
|
419
|
-
|
420
|
-
def test_shard_manager_aws_account_filtering_disabled(
|
421
|
-
aws_account_sharding_strategy: AWSAccountShardingStrategy,
|
422
|
-
):
|
423
|
-
# acc-4 is disabled for AWS_INTEGRATION
|
424
|
-
assert ["acc-1", "acc-2", "acc-3"] == [
|
425
|
-
a.name for a in aws_account_sharding_strategy.filter_objects(AWS_INTEGRATION)
|
426
|
-
]
|
427
|
-
|
428
|
-
|
429
|
-
# Static Sharding Tests
|
430
|
-
def test_build_helm_integration_spec_no_shards(
|
431
|
-
basic_integration: IntegrationV1,
|
432
|
-
shard_manager: IntegrationShardManager,
|
433
|
-
):
|
434
|
-
wr = intop.collect_integrations_environment(
|
435
|
-
[basic_integration], "test", shard_manager
|
436
|
-
)
|
437
|
-
|
438
|
-
expected_shard_spec = ShardSpec(
|
439
|
-
shards="1",
|
440
|
-
shard_id="0",
|
441
|
-
shard_spec_overrides=None,
|
442
|
-
shard_key="",
|
443
|
-
shard_name_suffix="",
|
444
|
-
extra_args="integ-extra-arg",
|
445
|
-
)
|
446
|
-
|
447
|
-
assert len(wr) == 1
|
448
|
-
shards = wr[0].integration_specs[0].shard_specs or []
|
449
|
-
assert len(shards) == 1
|
450
|
-
assert shards[0] == expected_shard_spec
|
451
|
-
|
452
|
-
|
453
|
-
def test_initialize_shard_specs_two_shards_explicit(
|
454
|
-
basic_integration: IntegrationV1,
|
455
|
-
shard_manager: intop.IntegrationShardManager,
|
456
|
-
):
|
457
|
-
|
458
|
-
static_sharding = StaticShardingV1(
|
459
|
-
strategy=StaticShardingStrategy.IDENTIFIER, shards=2
|
460
|
-
)
|
461
|
-
if basic_integration.managed:
|
462
|
-
basic_integration.managed[0].sharding = static_sharding
|
463
|
-
|
464
|
-
wr = intop.collect_integrations_environment(
|
465
|
-
[basic_integration], "test", shard_manager
|
466
|
-
)
|
467
|
-
|
468
|
-
expected = [
|
469
|
-
ShardSpec(
|
470
|
-
shard_id="0",
|
471
|
-
shards="2",
|
472
|
-
shard_name_suffix="-0",
|
473
|
-
extra_args="integ-extra-arg",
|
474
|
-
),
|
475
|
-
ShardSpec(
|
476
|
-
shard_id="1",
|
477
|
-
shards="2",
|
478
|
-
shard_name_suffix="-1",
|
479
|
-
extra_args="integ-extra-arg",
|
480
|
-
),
|
481
|
-
]
|
482
|
-
shards = wr[0].integration_specs[0].shard_specs or []
|
483
|
-
assert expected == shards
|
484
|
-
|
485
|
-
|
486
|
-
# Per-AWS-Account tests
|
487
|
-
def test_initialize_shard_specs_aws_account_shards(
|
488
|
-
basic_integration: IntegrationV1,
|
489
|
-
shard_manager: IntegrationShardManager,
|
490
|
-
):
|
491
|
-
"""
|
492
|
-
this test shows how the per-aws-account strategy fills the shard_specs and ignores
|
493
|
-
aws accounts where the integration is disabled
|
494
|
-
"""
|
495
|
-
aws_acc_sharding = AWSAccountShardingV1(
|
496
|
-
strategy="per-aws-account", shardSpecOverrides=None
|
497
|
-
)
|
498
|
-
|
499
|
-
basic_integration.name = AWS_INTEGRATION
|
500
|
-
if basic_integration.managed:
|
501
|
-
basic_integration.managed[0].sharding = aws_acc_sharding
|
502
|
-
|
503
|
-
wr = intop.collect_integrations_environment(
|
504
|
-
[basic_integration], "test", shard_manager
|
505
|
-
)
|
506
|
-
|
507
|
-
expected = [
|
508
|
-
ShardSpec(
|
509
|
-
shard_name_suffix="-acc-1",
|
510
|
-
shard_key="acc-1",
|
511
|
-
extra_args="integ-extra-arg --account-name acc-1",
|
512
|
-
),
|
513
|
-
ShardSpec(
|
514
|
-
shard_name_suffix="-acc-2",
|
515
|
-
shard_key="acc-2",
|
516
|
-
extra_args="integ-extra-arg --account-name acc-2",
|
517
|
-
),
|
518
|
-
ShardSpec(
|
519
|
-
shard_name_suffix="-acc-3",
|
520
|
-
shard_key="acc-3",
|
521
|
-
extra_args="integ-extra-arg --account-name acc-3",
|
522
|
-
),
|
523
|
-
]
|
524
|
-
|
525
|
-
shards = wr[0].integration_specs[0].shard_specs or []
|
526
|
-
assert expected == shards
|
527
|
-
|
528
|
-
|
529
|
-
@pytest.fixture
|
530
|
-
def aws_shard_overrides(
|
531
|
-
gql_class_factory: Callable[..., DeployResourcesFields],
|
532
|
-
resources: dict[str, Any],
|
533
|
-
aws_accounts: list[sharding_aws_accounts.AWSAccountV1],
|
534
|
-
) -> list[AWSAccountShardSpecOverrideV1]:
|
535
|
-
|
536
|
-
o1 = AWSAccountShardSpecOverrideV1(
|
537
|
-
shard=aws_accounts[0], imageRef="acc1-image", disabled=False, resources=None
|
538
|
-
)
|
539
|
-
resources["requests"]["cpu"] = "200m"
|
540
|
-
resources["requests"]["memory"] = "2Mi"
|
541
|
-
resources["limits"]["cpu"] = "300m"
|
542
|
-
resources["limits"]["memory"] = "3Mi"
|
543
|
-
|
544
|
-
deploy_resources = gql_class_factory(DeployResourcesFields, resources)
|
545
|
-
o2 = AWSAccountShardSpecOverrideV1(
|
546
|
-
shard=aws_accounts[1],
|
547
|
-
imageRef=None,
|
548
|
-
resources=deploy_resources,
|
549
|
-
disabled=False,
|
550
|
-
)
|
551
|
-
o3 = AWSAccountShardSpecOverrideV1(
|
552
|
-
shard=aws_accounts[2], resources=None, imageRef=None, disabled=True
|
553
|
-
)
|
554
|
-
|
555
|
-
return [o1, o2, o3]
|
556
|
-
|
557
|
-
|
558
|
-
def test_initialize_shard_specs_aws_account_shards_with_overrides(
|
559
|
-
basic_integration: IntegrationV1,
|
560
|
-
aws_shard_overrides: list[AWSAccountShardSpecOverrideV1],
|
561
|
-
shard_manager: IntegrationShardManager,
|
562
|
-
):
|
563
|
-
|
564
|
-
aws_acc_sharding = AWSAccountShardingV1(
|
565
|
-
strategy=AWSAccountShardingStrategy.IDENTIFIER,
|
566
|
-
shardSpecOverrides=aws_shard_overrides,
|
567
|
-
)
|
568
|
-
|
569
|
-
basic_integration.name = AWS_INTEGRATION
|
570
|
-
if basic_integration.managed:
|
571
|
-
basic_integration.managed[0].sharding = aws_acc_sharding
|
572
|
-
|
573
|
-
wr = intop.collect_integrations_environment(
|
574
|
-
[basic_integration], "test", shard_manager
|
575
|
-
)
|
576
|
-
|
577
|
-
expected = [
|
578
|
-
ShardSpec(
|
579
|
-
shard_name_suffix="-acc-1",
|
580
|
-
shard_key="acc-1",
|
581
|
-
extra_args="integ-extra-arg --account-name acc-1",
|
582
|
-
shard_spec_overrides=aws_shard_overrides[0],
|
583
|
-
),
|
584
|
-
ShardSpec(
|
585
|
-
shard_name_suffix="-acc-2",
|
586
|
-
shard_key="acc-2",
|
587
|
-
extra_args="integ-extra-arg --account-name acc-2",
|
588
|
-
shard_spec_overrides=aws_shard_overrides[1],
|
589
|
-
),
|
590
|
-
ShardSpec(
|
591
|
-
shard_name_suffix="-acc-3",
|
592
|
-
shard_key="acc-3",
|
593
|
-
extra_args="integ-extra-arg --account-name acc-3",
|
594
|
-
shard_spec_overrides=aws_shard_overrides[2],
|
595
|
-
),
|
596
|
-
]
|
597
|
-
|
598
|
-
shards = wr[0].integration_specs[0].shard_specs or []
|
599
|
-
assert expected == shards
|
600
|
-
|
601
|
-
|
602
|
-
def test_initialize_shard_specs_aws_account_shards_extra_args_aggregation(
|
603
|
-
basic_integration: IntegrationV1,
|
604
|
-
shard_manager: IntegrationShardManager,
|
605
|
-
):
|
606
|
-
"""
|
607
|
-
this test shows how the per-aws-account strategy fills the shard_specs and ignores
|
608
|
-
aws accounts where the integration is disabled
|
609
|
-
"""
|
610
|
-
aws_acc_sharding = AWSAccountShardingV1(
|
611
|
-
strategy="per-aws-account", shardSpecOverrides=None
|
612
|
-
)
|
613
|
-
|
614
|
-
basic_integration.name = AWS_INTEGRATION
|
615
|
-
if basic_integration.managed:
|
616
|
-
basic_integration.managed[0].sharding = aws_acc_sharding
|
617
|
-
basic_integration.managed[0].spec.extra_args = "--arg"
|
618
|
-
|
619
|
-
wr = intop.collect_integrations_environment(
|
620
|
-
[basic_integration], "test", shard_manager
|
621
|
-
)
|
622
|
-
|
623
|
-
expected = [
|
624
|
-
ShardSpec(
|
625
|
-
shard_name_suffix="-acc-1",
|
626
|
-
shard_key="acc-1",
|
627
|
-
extra_args="--arg --account-name acc-1",
|
628
|
-
),
|
629
|
-
ShardSpec(
|
630
|
-
shard_name_suffix="-acc-2",
|
631
|
-
shard_key="acc-2",
|
632
|
-
extra_args="--arg --account-name acc-2",
|
633
|
-
),
|
634
|
-
ShardSpec(
|
635
|
-
shard_name_suffix="-acc-3",
|
636
|
-
shard_key="acc-3",
|
637
|
-
extra_args="--arg --account-name acc-3",
|
638
|
-
),
|
639
|
-
]
|
640
|
-
|
641
|
-
shards = wr[0].integration_specs[0].shard_specs or []
|
642
|
-
assert expected == shards
|
643
|
-
|
644
|
-
|
645
|
-
# Per-Cloudflare-Zone Tests
|
646
|
-
@pytest.fixture
|
647
|
-
def cloudflarednszone_sharding() -> CloudflareDNSZoneShardingV1:
|
648
|
-
return CloudflareDNSZoneShardingV1(
|
649
|
-
strategy="per-cloudflare-dns-zone", shardSpecOverrides=None
|
650
|
-
)
|
651
|
-
|
652
|
-
|
653
|
-
def test_initialize_shard_specs_cloudflare_zone_shards(
|
654
|
-
basic_integration: IntegrationV1,
|
655
|
-
cloudflarednszone_sharding: CloudflareDNSZoneShardingV1,
|
656
|
-
shard_manager: intop.IntegrationShardManager,
|
657
|
-
):
|
658
|
-
"""
|
659
|
-
The per-cloudflare-zone strategy would result in two shards when there is two zones.
|
660
|
-
"""
|
661
|
-
if basic_integration.managed:
|
662
|
-
basic_integration.name = CLOUDFLARE_INTEGRATION
|
663
|
-
basic_integration.managed[0].sharding = cloudflarednszone_sharding
|
664
|
-
|
665
|
-
wr = intop.collect_integrations_environment(
|
666
|
-
[basic_integration], "test", shard_manager
|
667
|
-
)
|
668
|
-
|
669
|
-
expected = [
|
670
|
-
ShardSpec(
|
671
|
-
shard_key="fakeaccount-zone1",
|
672
|
-
shard_name_suffix="-fakeaccount-zone1",
|
673
|
-
extra_args="integ-extra-arg --zone-name zone1",
|
674
|
-
),
|
675
|
-
ShardSpec(
|
676
|
-
shard_key="fakeaccount-zone2",
|
677
|
-
shard_name_suffix="-fakeaccount-zone2",
|
678
|
-
extra_args="integ-extra-arg --zone-name zone2",
|
679
|
-
),
|
680
|
-
]
|
681
|
-
|
682
|
-
shards = wr[0].integration_specs[0].shard_specs or []
|
683
|
-
assert shards == expected
|
684
|
-
|
685
|
-
|
686
|
-
def test_initialize_shard_specs_cloudflare_zone_shards_raise_exception(
|
687
|
-
basic_integration: IntegrationV1,
|
688
|
-
cloudflarednszone_sharding: CloudflareDNSZoneShardingV1,
|
689
|
-
shard_manager: intop.IntegrationShardManager,
|
690
|
-
):
|
691
|
-
"""
|
692
|
-
The per-cloudflare-zone strategy will raise an exception when --zone-name is not set.
|
693
|
-
"""
|
694
|
-
if basic_integration.managed:
|
695
|
-
basic_integration.managed[0].sharding = cloudflarednszone_sharding
|
696
|
-
|
697
|
-
with pytest.raises(ValueError) as e:
|
698
|
-
intop.collect_integrations_environment(
|
699
|
-
[basic_integration], "test", shard_manager
|
700
|
-
)
|
701
|
-
|
702
|
-
assert (
|
703
|
-
e.value.args[0]
|
704
|
-
== f"integration basic-integration does not support the provided argument. --zone-name is required by the '{CloudflareDnsZoneShardingStrategy.IDENTIFIER}' sharding strategy."
|
705
|
-
)
|
706
|
-
|
707
|
-
|
708
|
-
# Per-Openshift-Clusters tests
|
709
|
-
@pytest.fixture
|
710
|
-
def openshift_clusters_sharding() -> OpenshiftClusterShardingV1:
|
711
|
-
return OpenshiftClusterShardingV1(
|
712
|
-
strategy=OpenshiftClusterShardingStrategy.IDENTIFIER, shardSpecOverrides=None
|
713
|
-
)
|
714
|
-
|
715
|
-
|
716
|
-
@pytest.fixture
|
717
|
-
def openshift_clusters_shard_spec_override(
|
718
|
-
openshift_clusters: list[ClusterV1], resources_2: dict[str, Any]
|
719
|
-
) -> OpenshiftClusterShardSpecOverrideV1:
|
720
|
-
return OpenshiftClusterShardSpecOverrideV1(
|
721
|
-
shard=OpenshiftClusterShardSpecOverrideV1_ClusterV1(
|
722
|
-
name=openshift_clusters[0].name
|
723
|
-
),
|
724
|
-
imageRef=None,
|
725
|
-
disabled=False,
|
726
|
-
resources=resources_2,
|
727
|
-
subSharding=None,
|
728
|
-
)
|
729
|
-
|
730
|
-
|
731
|
-
def test_initialize_shard_specs_openshift_clusters(
|
732
|
-
basic_integration: IntegrationV1,
|
733
|
-
openshift_clusters_sharding: OpenshiftClusterShardingV1,
|
734
|
-
shard_manager: IntegrationShardManager,
|
735
|
-
):
|
736
|
-
if basic_integration.managed:
|
737
|
-
basic_integration.name = OPENSHIFT_INTEGRATION
|
738
|
-
basic_integration.managed[0].sharding = openshift_clusters_sharding
|
739
|
-
|
740
|
-
wr = intop.collect_integrations_environment(
|
741
|
-
[basic_integration], "test", shard_manager
|
742
|
-
)
|
743
|
-
expected = [
|
744
|
-
ShardSpec(
|
745
|
-
shards="",
|
746
|
-
shard_id="",
|
747
|
-
shard_spec_overrides=None,
|
748
|
-
shard_key="cluster-1",
|
749
|
-
shard_name_suffix="-cluster-1",
|
750
|
-
extra_args="integ-extra-arg --cluster-name cluster-1",
|
751
|
-
),
|
752
|
-
ShardSpec(
|
753
|
-
shards="",
|
754
|
-
shard_id="",
|
755
|
-
shard_spec_overrides=None,
|
756
|
-
shard_key="cluster-2",
|
757
|
-
shard_name_suffix="-cluster-2",
|
758
|
-
extra_args="integ-extra-arg --cluster-name cluster-2",
|
759
|
-
),
|
760
|
-
]
|
761
|
-
shards = wr[0].integration_specs[0].shard_specs or []
|
762
|
-
assert shards == expected
|
763
|
-
|
764
|
-
|
765
|
-
def test_initialize_shard_specs_openshift_clusters_subsharding_w_overrides(
|
766
|
-
basic_integration: IntegrationV1,
|
767
|
-
openshift_clusters_sharding: OpenshiftClusterShardingV1,
|
768
|
-
openshift_clusters_shard_spec_override: OpenshiftClusterShardSpecOverrideV1,
|
769
|
-
shard_manager: IntegrationShardManager,
|
770
|
-
resources_2: dict[str, Any],
|
771
|
-
):
|
772
|
-
|
773
|
-
openshift_clusters_shard_spec_override.sub_sharding = StaticSubShardingV1(
|
774
|
-
strategy=StaticShardingStrategy.IDENTIFIER, shards=2
|
775
|
-
)
|
776
|
-
|
777
|
-
openshift_clusters_shard_spec_override.image_ref = "my-test-image"
|
778
|
-
|
779
|
-
if basic_integration.managed:
|
780
|
-
basic_integration.name = OPENSHIFT_INTEGRATION
|
781
|
-
basic_integration.managed[0].sharding = openshift_clusters_sharding
|
782
|
-
basic_integration.managed[0].sharding.shard_spec_overrides = [
|
783
|
-
openshift_clusters_shard_spec_override
|
784
|
-
]
|
785
|
-
|
786
|
-
wr = intop.collect_integrations_environment(
|
787
|
-
[basic_integration], "test", shard_manager
|
788
|
-
)
|
789
|
-
expected = [
|
790
|
-
ShardSpec(
|
791
|
-
shards="2",
|
792
|
-
shard_id="0",
|
793
|
-
shard_spec_overrides=OpenshiftClusterShardSpecOverrideV1(
|
794
|
-
shard=OpenshiftClusterShardSpecOverrideV1_ClusterV1(name="cluster-1"),
|
795
|
-
imageRef="my-test-image",
|
796
|
-
disabled=False,
|
797
|
-
resources=resources_2,
|
798
|
-
subSharding=None,
|
799
|
-
),
|
800
|
-
shard_key="cluster-1",
|
801
|
-
shard_name_suffix="-cluster-1-0",
|
802
|
-
extra_args="integ-extra-arg --cluster-name cluster-1",
|
803
|
-
),
|
804
|
-
ShardSpec(
|
805
|
-
shards="2",
|
806
|
-
shard_id="1",
|
807
|
-
shard_spec_overrides=OpenshiftClusterShardSpecOverrideV1(
|
808
|
-
shard=OpenshiftClusterShardSpecOverrideV1_ClusterV1(name="cluster-1"),
|
809
|
-
imageRef="my-test-image",
|
810
|
-
disabled=False,
|
811
|
-
resources=resources_2,
|
812
|
-
subSharding=None,
|
813
|
-
),
|
814
|
-
shard_key="cluster-1",
|
815
|
-
shard_name_suffix="-cluster-1-1",
|
816
|
-
extra_args="integ-extra-arg --cluster-name cluster-1",
|
817
|
-
),
|
818
|
-
ShardSpec(
|
819
|
-
shards="",
|
820
|
-
shard_id="",
|
821
|
-
shard_spec_overrides=None,
|
822
|
-
shard_key="cluster-2",
|
823
|
-
shard_name_suffix="-cluster-2",
|
824
|
-
extra_args="integ-extra-arg --cluster-name cluster-2",
|
825
|
-
),
|
826
|
-
]
|
827
|
-
shards = wr[0].integration_specs[0].shard_specs or []
|
828
|
-
assert shards == expected
|
829
|
-
|
830
|
-
|
831
|
-
def test_initialize_shard_specs_openshift_clusters_disabled_shard(
|
832
|
-
basic_integration: IntegrationV1,
|
833
|
-
openshift_clusters_sharding: OpenshiftClusterShardingV1,
|
834
|
-
openshift_clusters_shard_spec_override: OpenshiftClusterShardSpecOverrideV1,
|
835
|
-
shard_manager: IntegrationShardManager,
|
836
|
-
resources_2: dict[str, Any],
|
837
|
-
):
|
838
|
-
|
839
|
-
openshift_clusters_shard_spec_override.disabled = True
|
840
|
-
|
841
|
-
if basic_integration.managed:
|
842
|
-
basic_integration.name = OPENSHIFT_INTEGRATION
|
843
|
-
basic_integration.managed[0].sharding = openshift_clusters_sharding
|
844
|
-
basic_integration.managed[0].sharding.shard_spec_overrides = [
|
845
|
-
openshift_clusters_shard_spec_override
|
846
|
-
]
|
847
|
-
|
848
|
-
wr = intop.collect_integrations_environment(
|
849
|
-
[basic_integration], "test", shard_manager
|
850
|
-
)
|
851
|
-
expected = [
|
852
|
-
ShardSpec(
|
853
|
-
shards="",
|
854
|
-
shard_id="",
|
855
|
-
shard_spec_overrides=OpenshiftClusterShardSpecOverrideV1(
|
856
|
-
shard=OpenshiftClusterShardSpecOverrideV1_ClusterV1(name="cluster-1"),
|
857
|
-
imageRef=None,
|
858
|
-
disabled=True,
|
859
|
-
resources=resources_2,
|
860
|
-
subSharding=None,
|
861
|
-
),
|
862
|
-
shard_key="cluster-1",
|
863
|
-
shard_name_suffix="-cluster-1",
|
864
|
-
extra_args="integ-extra-arg --cluster-name cluster-1",
|
865
|
-
),
|
866
|
-
ShardSpec(
|
867
|
-
shards="",
|
868
|
-
shard_id="",
|
869
|
-
shard_spec_overrides=None,
|
870
|
-
shard_key="cluster-2",
|
871
|
-
shard_name_suffix="-cluster-2",
|
872
|
-
extra_args="integ-extra-arg --cluster-name cluster-2",
|
873
|
-
),
|
874
|
-
]
|
875
|
-
shards = wr[0].integration_specs[0].shard_specs or []
|
876
|
-
assert shards == expected
|
877
|
-
|
878
|
-
|
879
|
-
def test_fetch_desired_state(
|
880
|
-
basic_integration: IntegrationV1,
|
881
|
-
shard_manager: intop.IntegrationShardManager,
|
882
|
-
):
|
883
|
-
integrations_environments = intop.collect_integrations_environment(
|
884
|
-
[basic_integration], "test", shard_manager
|
885
|
-
)
|
886
|
-
# intop.initialize_shard_specs(collected_namespaces_env_test1, shard_manager)
|
887
|
-
ri = ResourceInventory()
|
888
|
-
ri.initialize_resource_type("cluster", "ns", "Deployment")
|
889
|
-
ri.initialize_resource_type("cluster", "ns", "Service")
|
890
|
-
intop.fetch_desired_state(
|
891
|
-
integrations_environments=integrations_environments,
|
892
|
-
ri=ri,
|
893
|
-
upstream="http://localhost",
|
894
|
-
image="image",
|
895
|
-
image_tag_from_ref=None,
|
896
|
-
)
|
897
|
-
|
898
|
-
resources = [
|
899
|
-
(cluster, namespace, kind, list(data["desired"].keys()))
|
900
|
-
for cluster, namespace, kind, data in list(ri)
|
901
|
-
]
|
902
|
-
|
903
|
-
assert len(resources) == 2
|
904
|
-
assert (
|
905
|
-
"cluster",
|
906
|
-
"ns",
|
907
|
-
"Deployment",
|
908
|
-
["qontract-reconcile-basic-integration"],
|
909
|
-
) in resources
|
910
|
-
assert ("cluster", "ns", "Service", ["qontract-reconcile"]) in resources
|
911
|
-
|
912
|
-
|
913
|
-
def test_fetch_desired_state_upstream(
|
914
|
-
basic_integration: IntegrationV1,
|
915
|
-
shard_manager: intop.IntegrationShardManager,
|
916
|
-
):
|
917
|
-
upstream = "a"
|
918
|
-
basic_integration.upstream = upstream
|
919
|
-
|
920
|
-
integrations_environments = intop.collect_integrations_environment(
|
921
|
-
[basic_integration], "test", shard_manager
|
922
|
-
)
|
923
|
-
|
924
|
-
ri = ResourceInventory()
|
925
|
-
ri.initialize_resource_type("cluster", "ns", "Deployment")
|
926
|
-
ri.initialize_resource_type("cluster", "ns", "Service")
|
927
|
-
|
928
|
-
intop.fetch_desired_state(
|
929
|
-
integrations_environments=integrations_environments,
|
930
|
-
ri=ri,
|
931
|
-
upstream=upstream,
|
932
|
-
image="image",
|
933
|
-
image_tag_from_ref=None,
|
934
|
-
)
|
935
|
-
|
936
|
-
resources = [
|
937
|
-
(cluster, namespace, kind, list(data["desired"].keys()), data["desired"])
|
938
|
-
for cluster, namespace, kind, data in list(ri)
|
939
|
-
]
|
940
|
-
|
941
|
-
assert len(resources) == 2
|
942
|
-
assert [
|
943
|
-
x[4]["qontract-reconcile-basic-integration"].caller
|
944
|
-
for x in resources
|
945
|
-
if x[3] == ["qontract-reconcile-basic-integration"]
|
946
|
-
] == [upstream]
|
947
|
-
|
948
|
-
|
949
|
-
@pytest.fixture
|
950
|
-
def integrations(basic_integration: IntegrationV1) -> list[IntegrationV1]:
|
951
|
-
i1 = basic_integration
|
952
|
-
i2 = copy.deepcopy(i1)
|
953
|
-
i3 = copy.deepcopy(i1)
|
954
|
-
i4 = copy.deepcopy(i1)
|
955
|
-
if i2.managed:
|
956
|
-
i2.managed[0].namespace.environment.name = "test2"
|
957
|
-
if i3.managed:
|
958
|
-
i3.managed[0].namespace.environment.name = "test2"
|
959
|
-
if i4.managed:
|
960
|
-
i4.managed[0].namespace.environment.name = "test3"
|
961
|
-
return [i1, i2, i3, i4]
|
962
|
-
|
963
|
-
|
964
|
-
def test_collect_ingegrations_environment(
|
965
|
-
integrations: list[IntegrationV1], shard_manager: IntegrationShardManager
|
966
|
-
):
|
967
|
-
ie = intop.collect_integrations_environment(integrations, "test2", shard_manager)
|
968
|
-
assert len(ie[0].integration_specs) == 2
|
969
|
-
assert ie[0].namespace.environment.name == "test2"
|
970
|
-
|
971
|
-
|
972
|
-
def test_collect_ingegrations_environment_no_env(
|
973
|
-
integrations: list[IntegrationV1], shard_manager: IntegrationShardManager
|
974
|
-
):
|
975
|
-
ie = intop.collect_integrations_environment(integrations, "", shard_manager)
|
976
|
-
assert len(ie[0].integration_specs) == 4
|
977
|
-
|
978
|
-
|
979
|
-
def test_filter_with_upstream(integrations: list[IntegrationV1]):
|
980
|
-
upstream = "an-upstream"
|
981
|
-
if integrations:
|
982
|
-
integrations[0].name = "integ-with-upstream"
|
983
|
-
integrations[0].upstream = upstream
|
984
|
-
|
985
|
-
filtered_integrations = intop.filter_integrations(integrations, upstream)
|
986
|
-
|
987
|
-
assert isinstance(filtered_integrations, list)
|
988
|
-
assert len(filtered_integrations) == 1
|
989
|
-
assert filtered_integrations[0].name == "integ-with-upstream"
|
990
|
-
|
991
|
-
|
992
|
-
def test_filter_with_upstream_none(integrations: Iterable[IntegrationV1]):
|
993
|
-
filtered_integrations = intop.filter_integrations(integrations, None)
|
994
|
-
|
995
|
-
assert filtered_integrations == integrations
|