qontract-reconcile 0.10.2.dev299__py3-none-any.whl → 0.10.2.dev430__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.2.dev299.dist-info → qontract_reconcile-0.10.2.dev430.dist-info}/METADATA +13 -12
- {qontract_reconcile-0.10.2.dev299.dist-info → qontract_reconcile-0.10.2.dev430.dist-info}/RECORD +399 -394
- reconcile/acs_rbac.py +2 -2
- reconcile/aus/advanced_upgrade_service.py +18 -12
- reconcile/aus/base.py +134 -32
- reconcile/aus/cluster_version_data.py +15 -5
- reconcile/aus/models.py +3 -1
- reconcile/aus/ocm_addons_upgrade_scheduler_org.py +1 -0
- reconcile/aus/ocm_upgrade_scheduler.py +8 -1
- reconcile/aus/ocm_upgrade_scheduler_org.py +20 -5
- reconcile/aus/version_gates/sts_version_gate_handler.py +54 -1
- reconcile/automated_actions/config/integration.py +16 -4
- reconcile/aws_account_manager/integration.py +8 -8
- reconcile/aws_account_manager/reconciler.py +3 -3
- reconcile/aws_ami_cleanup/integration.py +8 -12
- reconcile/aws_ami_share.py +69 -62
- reconcile/aws_cloudwatch_log_retention/integration.py +155 -126
- reconcile/aws_ecr_image_pull_secrets.py +4 -4
- reconcile/aws_iam_keys.py +1 -0
- reconcile/aws_saml_idp/integration.py +12 -4
- reconcile/aws_saml_roles/integration.py +32 -25
- reconcile/aws_version_sync/integration.py +125 -84
- reconcile/change_owners/bundle.py +3 -3
- reconcile/change_owners/change_log_tracking.py +3 -2
- reconcile/change_owners/change_owners.py +1 -1
- reconcile/change_owners/diff.py +2 -4
- reconcile/checkpoint.py +12 -4
- reconcile/cli.py +111 -18
- reconcile/cluster_deployment_mapper.py +2 -3
- reconcile/dashdotdb_dora.py +5 -12
- reconcile/dashdotdb_slo.py +1 -1
- reconcile/database_access_manager.py +125 -121
- reconcile/deadmanssnitch.py +1 -5
- reconcile/dynatrace_token_provider/integration.py +1 -1
- reconcile/endpoints_discovery/integration.py +4 -1
- reconcile/endpoints_discovery/merge_request.py +1 -1
- reconcile/endpoints_discovery/merge_request_manager.py +9 -11
- reconcile/external_resources/factories.py +5 -12
- reconcile/external_resources/integration.py +1 -1
- reconcile/external_resources/manager.py +8 -5
- reconcile/external_resources/meta.py +0 -1
- reconcile/external_resources/metrics.py +1 -1
- reconcile/external_resources/model.py +20 -20
- reconcile/external_resources/reconciler.py +7 -4
- reconcile/external_resources/secrets_sync.py +8 -11
- reconcile/external_resources/state.py +26 -16
- reconcile/fleet_labeler/integration.py +1 -1
- reconcile/gabi_authorized_users.py +8 -5
- reconcile/gcp_image_mirror.py +2 -2
- reconcile/github_org.py +1 -1
- reconcile/github_owners.py +4 -0
- reconcile/gitlab_housekeeping.py +13 -15
- reconcile/gitlab_members.py +6 -12
- reconcile/gitlab_mr_sqs_consumer.py +2 -2
- reconcile/gitlab_owners.py +15 -11
- reconcile/gitlab_permissions.py +8 -12
- reconcile/glitchtip_project_alerts/integration.py +3 -1
- reconcile/gql_definitions/acs/acs_instances.py +10 -10
- reconcile/gql_definitions/acs/acs_policies.py +5 -5
- reconcile/gql_definitions/acs/acs_rbac.py +6 -6
- reconcile/gql_definitions/advanced_upgrade_service/aus_clusters.py +32 -32
- reconcile/gql_definitions/advanced_upgrade_service/aus_organization.py +26 -26
- reconcile/gql_definitions/app_interface_metrics_exporter/onboarding_status.py +6 -7
- reconcile/gql_definitions/app_sre_tekton_access_revalidation/roles.py +5 -5
- reconcile/gql_definitions/app_sre_tekton_access_revalidation/users.py +5 -5
- reconcile/gql_definitions/automated_actions/instance.py +51 -12
- reconcile/gql_definitions/aws_account_manager/aws_accounts.py +11 -11
- reconcile/gql_definitions/aws_ami_cleanup/aws_accounts.py +20 -10
- reconcile/gql_definitions/aws_cloudwatch_log_retention/aws_accounts.py +28 -68
- reconcile/gql_definitions/aws_saml_idp/aws_accounts.py +20 -10
- reconcile/gql_definitions/aws_saml_roles/aws_accounts.py +20 -10
- reconcile/gql_definitions/aws_saml_roles/roles.py +5 -5
- reconcile/gql_definitions/aws_version_sync/clusters.py +10 -10
- reconcile/gql_definitions/aws_version_sync/namespaces.py +5 -5
- reconcile/gql_definitions/change_owners/queries/change_types.py +5 -5
- reconcile/gql_definitions/change_owners/queries/self_service_roles.py +9 -9
- reconcile/gql_definitions/cluster_auth_rhidp/clusters.py +18 -18
- reconcile/gql_definitions/common/alerting_services_settings.py +9 -9
- reconcile/gql_definitions/common/app_code_component_repos.py +5 -5
- reconcile/gql_definitions/common/app_interface_custom_messages.py +5 -5
- reconcile/gql_definitions/common/app_interface_dms_settings.py +5 -5
- reconcile/gql_definitions/common/app_interface_repo_settings.py +5 -5
- reconcile/gql_definitions/common/app_interface_roles.py +120 -0
- reconcile/gql_definitions/common/app_interface_state_settings.py +10 -10
- reconcile/gql_definitions/common/app_interface_vault_settings.py +5 -5
- reconcile/gql_definitions/common/app_quay_repos_escalation_policies.py +5 -5
- reconcile/gql_definitions/common/apps.py +5 -5
- reconcile/gql_definitions/common/aws_vpc_requests.py +23 -10
- reconcile/gql_definitions/common/aws_vpcs.py +11 -11
- reconcile/gql_definitions/common/clusters.py +37 -35
- reconcile/gql_definitions/common/clusters_minimal.py +14 -14
- reconcile/gql_definitions/common/clusters_with_dms.py +6 -6
- reconcile/gql_definitions/common/clusters_with_peering.py +29 -30
- reconcile/gql_definitions/common/github_orgs.py +10 -10
- reconcile/gql_definitions/common/jira_settings.py +10 -10
- reconcile/gql_definitions/common/jiralert_settings.py +5 -5
- reconcile/gql_definitions/common/ldap_settings.py +5 -5
- reconcile/gql_definitions/common/namespaces.py +42 -44
- reconcile/gql_definitions/common/namespaces_minimal.py +15 -13
- reconcile/gql_definitions/common/ocm_env_telemeter.py +12 -12
- reconcile/gql_definitions/common/ocm_environments.py +19 -19
- reconcile/gql_definitions/common/pagerduty_instances.py +9 -9
- reconcile/gql_definitions/common/pgp_reencryption_settings.py +6 -6
- reconcile/gql_definitions/common/pipeline_providers.py +29 -29
- reconcile/gql_definitions/common/quay_instances.py +5 -5
- reconcile/gql_definitions/common/quay_orgs.py +5 -5
- reconcile/gql_definitions/common/reserved_networks.py +5 -5
- reconcile/gql_definitions/common/rhcs_provider_settings.py +5 -5
- reconcile/gql_definitions/common/saas_files.py +44 -44
- reconcile/gql_definitions/common/saas_target_namespaces.py +10 -10
- reconcile/gql_definitions/common/saasherder_settings.py +5 -5
- reconcile/gql_definitions/common/slack_workspaces.py +5 -5
- reconcile/gql_definitions/common/smtp_client_settings.py +19 -19
- reconcile/gql_definitions/common/state_aws_account.py +7 -8
- reconcile/gql_definitions/common/users.py +5 -5
- reconcile/gql_definitions/common/users_with_paths.py +5 -5
- reconcile/gql_definitions/cost_report/app_names.py +5 -5
- reconcile/gql_definitions/cost_report/cost_namespaces.py +5 -5
- reconcile/gql_definitions/cost_report/settings.py +9 -9
- reconcile/gql_definitions/dashdotdb_slo/slo_documents_query.py +43 -43
- reconcile/gql_definitions/dynatrace_token_provider/dynatrace_bootstrap_tokens.py +10 -10
- reconcile/gql_definitions/dynatrace_token_provider/token_specs.py +5 -5
- reconcile/gql_definitions/email_sender/apps.py +5 -5
- reconcile/gql_definitions/email_sender/emails.py +8 -8
- reconcile/gql_definitions/email_sender/users.py +6 -6
- reconcile/gql_definitions/endpoints_discovery/apps.py +10 -10
- reconcile/gql_definitions/external_resources/aws_accounts.py +9 -9
- reconcile/gql_definitions/external_resources/external_resources_modules.py +23 -23
- reconcile/gql_definitions/external_resources/external_resources_namespaces.py +492 -410
- reconcile/gql_definitions/external_resources/external_resources_settings.py +28 -26
- reconcile/gql_definitions/external_resources/fragments/external_resources_module_overrides.py +5 -5
- reconcile/gql_definitions/fleet_labeler/fleet_labels.py +40 -40
- reconcile/gql_definitions/fragments/aus_organization.py +5 -5
- reconcile/gql_definitions/fragments/aws_account_common.py +7 -5
- reconcile/gql_definitions/fragments/aws_account_managed.py +5 -5
- reconcile/gql_definitions/fragments/aws_account_sso.py +5 -5
- reconcile/gql_definitions/fragments/aws_infra_management_account.py +5 -5
- reconcile/gql_definitions/fragments/{aws_vpc_request_subnet.py → aws_organization.py} +12 -8
- reconcile/gql_definitions/fragments/aws_vpc.py +5 -5
- reconcile/gql_definitions/fragments/aws_vpc_request.py +10 -5
- reconcile/gql_definitions/fragments/container_image_mirror.py +5 -5
- reconcile/gql_definitions/fragments/deploy_resources.py +5 -5
- reconcile/gql_definitions/fragments/disable.py +5 -5
- reconcile/gql_definitions/fragments/email_service.py +5 -5
- reconcile/gql_definitions/fragments/email_user.py +5 -5
- reconcile/gql_definitions/fragments/jumphost_common_fields.py +5 -5
- reconcile/gql_definitions/fragments/membership_source.py +5 -5
- reconcile/gql_definitions/fragments/minimal_ocm_organization.py +5 -5
- reconcile/gql_definitions/fragments/oc_connection_cluster.py +5 -5
- reconcile/gql_definitions/fragments/ocm_environment.py +5 -5
- reconcile/gql_definitions/fragments/pipeline_provider_retention.py +5 -5
- reconcile/gql_definitions/fragments/prometheus_instance.py +5 -5
- reconcile/gql_definitions/fragments/resource_limits_requirements.py +5 -5
- reconcile/gql_definitions/fragments/resource_requests_requirements.py +5 -5
- reconcile/gql_definitions/fragments/resource_values.py +5 -5
- reconcile/gql_definitions/fragments/saas_slo_document.py +5 -5
- reconcile/gql_definitions/fragments/saas_target_namespace.py +5 -5
- reconcile/gql_definitions/fragments/serviceaccount_token.py +5 -5
- reconcile/gql_definitions/fragments/terraform_state.py +5 -5
- reconcile/gql_definitions/fragments/upgrade_policy.py +5 -5
- reconcile/gql_definitions/fragments/user.py +5 -5
- reconcile/gql_definitions/fragments/vault_secret.py +5 -5
- reconcile/gql_definitions/gcp/gcp_docker_repos.py +9 -9
- reconcile/gql_definitions/gcp/gcp_projects.py +9 -9
- reconcile/gql_definitions/gitlab_members/gitlab_instances.py +9 -9
- reconcile/gql_definitions/gitlab_members/permissions.py +9 -9
- reconcile/gql_definitions/glitchtip/glitchtip_instance.py +9 -9
- reconcile/gql_definitions/glitchtip/glitchtip_project.py +11 -11
- reconcile/gql_definitions/glitchtip_project_alerts/glitchtip_project.py +9 -9
- reconcile/gql_definitions/integrations/integrations.py +48 -51
- reconcile/gql_definitions/introspection.json +3050 -1393
- reconcile/gql_definitions/jenkins_configs/jenkins_configs.py +11 -11
- reconcile/gql_definitions/jenkins_configs/jenkins_instances.py +10 -10
- reconcile/gql_definitions/jira/jira_servers.py +5 -5
- reconcile/gql_definitions/jira_permissions_validator/jira_boards_for_permissions_validator.py +14 -10
- reconcile/gql_definitions/jumphosts/jumphosts.py +13 -13
- reconcile/gql_definitions/ldap_groups/roles.py +5 -5
- reconcile/gql_definitions/ldap_groups/settings.py +9 -9
- reconcile/gql_definitions/maintenance/maintenances.py +5 -5
- reconcile/gql_definitions/membershipsources/roles.py +5 -5
- reconcile/gql_definitions/ocm_labels/clusters.py +18 -19
- reconcile/gql_definitions/ocm_labels/organizations.py +5 -5
- reconcile/gql_definitions/openshift_cluster_bots/clusters.py +22 -22
- reconcile/gql_definitions/openshift_groups/managed_groups.py +5 -5
- reconcile/gql_definitions/openshift_groups/managed_roles.py +6 -6
- reconcile/gql_definitions/openshift_serviceaccount_tokens/tokens.py +10 -10
- reconcile/gql_definitions/quay_membership/quay_membership.py +6 -6
- reconcile/gql_definitions/rhcs/certs.py +33 -87
- reconcile/gql_definitions/rhcs/openshift_resource_rhcs_cert.py +43 -0
- reconcile/gql_definitions/rhidp/organizations.py +18 -18
- reconcile/gql_definitions/service_dependencies/jenkins_instance_fragment.py +5 -5
- reconcile/gql_definitions/service_dependencies/service_dependencies.py +8 -8
- reconcile/gql_definitions/sharding/aws_accounts.py +10 -10
- reconcile/gql_definitions/sharding/ocm_organization.py +8 -8
- reconcile/gql_definitions/skupper_network/site_controller_template.py +5 -5
- reconcile/gql_definitions/skupper_network/skupper_networks.py +10 -10
- reconcile/gql_definitions/slack_usergroups/clusters.py +5 -5
- reconcile/gql_definitions/slack_usergroups/permissions.py +9 -9
- reconcile/gql_definitions/slack_usergroups/users.py +5 -5
- reconcile/gql_definitions/slo_documents/slo_documents.py +5 -5
- reconcile/gql_definitions/status_board/status_board.py +6 -7
- reconcile/gql_definitions/statuspage/statuspages.py +9 -9
- reconcile/gql_definitions/templating/template_collection.py +5 -5
- reconcile/gql_definitions/templating/templates.py +5 -5
- reconcile/gql_definitions/terraform_cloudflare_dns/app_interface_cloudflare_dns_settings.py +6 -6
- reconcile/gql_definitions/terraform_cloudflare_dns/terraform_cloudflare_zones.py +11 -11
- reconcile/gql_definitions/terraform_cloudflare_resources/terraform_cloudflare_accounts.py +11 -11
- reconcile/gql_definitions/terraform_cloudflare_resources/terraform_cloudflare_resources.py +20 -25
- reconcile/gql_definitions/terraform_cloudflare_users/app_interface_setting_cloudflare_and_vault.py +6 -6
- reconcile/gql_definitions/terraform_cloudflare_users/terraform_cloudflare_roles.py +12 -12
- reconcile/gql_definitions/terraform_init/aws_accounts.py +23 -9
- reconcile/gql_definitions/terraform_repo/terraform_repo.py +9 -9
- reconcile/gql_definitions/terraform_resources/database_access_manager.py +5 -5
- reconcile/gql_definitions/terraform_resources/terraform_resources_namespaces.py +448 -402
- reconcile/gql_definitions/terraform_tgw_attachments/aws_accounts.py +23 -17
- reconcile/gql_definitions/unleash_feature_toggles/feature_toggles.py +9 -9
- reconcile/gql_definitions/vault_instances/vault_instances.py +61 -61
- reconcile/gql_definitions/vault_policies/vault_policies.py +11 -11
- reconcile/gql_definitions/vpc_peerings_validator/vpc_peerings_validator.py +8 -8
- reconcile/gql_definitions/vpc_peerings_validator/vpc_peerings_validator_peered_cluster_fragment.py +5 -5
- reconcile/integrations_manager.py +3 -3
- reconcile/jenkins_job_builder.py +1 -1
- reconcile/jenkins_worker_fleets.py +80 -11
- reconcile/jira_permissions_validator.py +237 -122
- reconcile/ldap_groups/integration.py +1 -1
- reconcile/ocm/types.py +35 -56
- reconcile/ocm_aws_infrastructure_access.py +1 -1
- reconcile/ocm_clusters.py +4 -4
- reconcile/ocm_labels/integration.py +3 -2
- reconcile/ocm_machine_pools.py +33 -27
- reconcile/openshift_base.py +122 -10
- reconcile/openshift_cluster_bots.py +5 -5
- reconcile/openshift_groups.py +5 -0
- reconcile/openshift_limitranges.py +1 -1
- reconcile/openshift_namespace_labels.py +1 -1
- reconcile/openshift_namespaces.py +97 -101
- reconcile/openshift_resources_base.py +10 -5
- reconcile/openshift_rhcs_certs.py +77 -40
- reconcile/openshift_rolebindings.py +230 -130
- reconcile/openshift_saas_deploy.py +6 -7
- reconcile/openshift_saas_deploy_change_tester.py +9 -7
- reconcile/openshift_saas_deploy_trigger_cleaner.py +3 -5
- reconcile/openshift_serviceaccount_tokens.py +8 -7
- reconcile/openshift_tekton_resources.py +1 -1
- reconcile/openshift_upgrade_watcher.py +4 -4
- reconcile/openshift_users.py +5 -3
- reconcile/oum/labelset.py +5 -3
- reconcile/oum/models.py +1 -4
- reconcile/oum/providers.py +1 -1
- reconcile/prometheus_rules_tester/integration.py +4 -4
- reconcile/quay_mirror.py +1 -1
- reconcile/queries.py +131 -0
- reconcile/requests_sender.py +8 -3
- reconcile/resource_scraper.py +1 -5
- reconcile/rhidp/common.py +5 -5
- reconcile/rhidp/sso_client/base.py +19 -10
- reconcile/saas_auto_promotions_manager/merge_request_manager/renderer.py +1 -1
- reconcile/saas_auto_promotions_manager/subscriber.py +4 -3
- reconcile/sendgrid_teammates.py +20 -9
- reconcile/skupper_network/integration.py +2 -2
- reconcile/slack_usergroups.py +35 -14
- reconcile/sql_query.py +1 -0
- reconcile/status.py +2 -2
- reconcile/status_board.py +6 -6
- reconcile/statuspage/atlassian.py +7 -7
- reconcile/statuspage/integrations/maintenances.py +4 -3
- reconcile/statuspage/page.py +4 -9
- reconcile/statuspage/status.py +5 -8
- reconcile/templates/rosa-classic-cluster-creation.sh.j2 +4 -0
- reconcile/templates/rosa-hcp-cluster-creation.sh.j2 +3 -0
- reconcile/templating/lib/merge_request_manager.py +2 -2
- reconcile/templating/lib/rendering.py +3 -3
- reconcile/templating/renderer.py +12 -13
- reconcile/terraform_aws_route53.py +18 -8
- reconcile/terraform_cloudflare_dns.py +3 -3
- reconcile/terraform_cloudflare_resources.py +12 -13
- reconcile/terraform_cloudflare_users.py +3 -2
- reconcile/terraform_init/integration.py +187 -23
- reconcile/terraform_repo.py +16 -12
- reconcile/terraform_resources.py +18 -10
- reconcile/terraform_tgw_attachments.py +27 -19
- reconcile/terraform_users.py +29 -21
- reconcile/terraform_vpc_peerings.py +16 -4
- reconcile/terraform_vpc_resources/integration.py +32 -2
- reconcile/typed_queries/app_interface_roles.py +10 -0
- reconcile/typed_queries/aws_account_tags.py +41 -0
- reconcile/typed_queries/cost_report/app_names.py +1 -1
- reconcile/typed_queries/cost_report/cost_namespaces.py +2 -2
- reconcile/typed_queries/saas_files.py +13 -13
- reconcile/typed_queries/status_board.py +2 -2
- reconcile/unleash_feature_toggles/integration.py +4 -2
- reconcile/utils/acs/base.py +6 -3
- reconcile/utils/acs/policies.py +2 -2
- reconcile/utils/aggregated_list.py +4 -3
- reconcile/utils/aws_api.py +51 -20
- reconcile/utils/aws_api_typed/api.py +38 -9
- reconcile/utils/aws_api_typed/cloudformation.py +149 -0
- reconcile/utils/aws_api_typed/logs.py +73 -0
- reconcile/utils/aws_api_typed/organization.py +4 -2
- reconcile/utils/binary.py +7 -12
- reconcile/utils/datetime_util.py +67 -0
- reconcile/utils/deadmanssnitch_api.py +1 -1
- reconcile/utils/differ.py +2 -3
- reconcile/utils/early_exit_cache.py +11 -12
- reconcile/utils/expiration.py +7 -3
- reconcile/utils/external_resource_spec.py +24 -1
- reconcile/utils/filtering.py +1 -1
- reconcile/utils/gitlab_api.py +7 -5
- reconcile/utils/glitchtip/client.py +6 -2
- reconcile/utils/glitchtip/models.py +25 -28
- reconcile/utils/gpg.py +5 -3
- reconcile/utils/gql.py +4 -7
- reconcile/utils/helm.py +2 -1
- reconcile/utils/helpers.py +1 -1
- reconcile/utils/imap_client.py +1 -1
- reconcile/utils/instrumented_wrappers.py +1 -1
- reconcile/utils/internal_groups/client.py +2 -2
- reconcile/utils/internal_groups/models.py +8 -17
- reconcile/utils/jenkins_api.py +24 -1
- reconcile/utils/jinja2/utils.py +6 -8
- reconcile/utils/jira_client.py +82 -63
- reconcile/utils/jjb_client.py +59 -43
- reconcile/utils/jobcontroller/controller.py +2 -2
- reconcile/utils/jobcontroller/models.py +17 -1
- reconcile/utils/json.py +74 -0
- reconcile/utils/ldap_client.py +4 -3
- reconcile/utils/lean_terraform_client.py +3 -1
- reconcile/utils/membershipsources/app_interface_resolver.py +4 -2
- reconcile/utils/membershipsources/models.py +16 -23
- reconcile/utils/membershipsources/resolver.py +4 -2
- reconcile/utils/merge_request_manager/merge_request_manager.py +4 -4
- reconcile/utils/merge_request_manager/parser.py +6 -6
- reconcile/utils/metrics.py +5 -5
- reconcile/utils/models.py +304 -82
- reconcile/utils/mr/__init__.py +3 -1
- reconcile/utils/mr/app_interface_reporter.py +6 -3
- reconcile/utils/mr/aws_access.py +1 -1
- reconcile/utils/mr/base.py +7 -13
- reconcile/utils/mr/clusters_updates.py +4 -2
- reconcile/utils/mr/notificator.py +3 -3
- reconcile/utils/mr/ocm_upgrade_scheduler_org_updates.py +4 -1
- reconcile/utils/mr/promote_qontract.py +28 -12
- reconcile/utils/mr/update_access_report_base.py +3 -4
- reconcile/utils/mr/user_maintenance.py +7 -6
- reconcile/utils/oc.py +445 -336
- reconcile/utils/oc_filters.py +3 -3
- reconcile/utils/ocm/addons.py +0 -1
- reconcile/utils/ocm/base.py +27 -20
- reconcile/utils/ocm/cluster_groups.py +1 -1
- reconcile/utils/ocm/identity_providers.py +2 -2
- reconcile/utils/ocm/labels.py +1 -1
- reconcile/utils/ocm/ocm.py +81 -71
- reconcile/utils/ocm/products.py +9 -3
- reconcile/utils/ocm/search_filters.py +3 -6
- reconcile/utils/ocm/service_log.py +4 -6
- reconcile/utils/ocm/sre_capability_labels.py +20 -13
- reconcile/utils/ocm_base_client.py +4 -4
- reconcile/utils/openshift_resource.py +83 -52
- reconcile/utils/openssl.py +2 -2
- reconcile/utils/output.py +3 -2
- reconcile/utils/pagerduty_api.py +10 -7
- reconcile/utils/promotion_state.py +6 -11
- reconcile/utils/raw_github_api.py +11 -8
- reconcile/utils/repo_owners.py +21 -29
- reconcile/utils/rhcsv2_certs.py +138 -35
- reconcile/utils/rosa/session.py +16 -0
- reconcile/utils/runtime/integration.py +2 -3
- reconcile/utils/runtime/meta.py +2 -1
- reconcile/utils/runtime/runner.py +2 -2
- reconcile/utils/saasherder/interfaces.py +13 -20
- reconcile/utils/saasherder/models.py +25 -21
- reconcile/utils/saasherder/saasherder.py +60 -32
- reconcile/utils/secret_reader.py +6 -6
- reconcile/utils/sharding.py +1 -1
- reconcile/utils/slack_api.py +26 -4
- reconcile/utils/sloth.py +224 -0
- reconcile/utils/sqs_gateway.py +16 -11
- reconcile/utils/state.py +2 -1
- reconcile/utils/structs.py +4 -4
- reconcile/utils/terraform_client.py +32 -29
- reconcile/utils/terrascript_aws_client.py +658 -480
- reconcile/utils/three_way_diff_strategy.py +1 -1
- reconcile/utils/throughput.py +1 -1
- reconcile/utils/unleash/server.py +2 -8
- reconcile/utils/vault.py +44 -41
- reconcile/utils/vcs.py +8 -8
- reconcile/vault_replication.py +119 -58
- reconcile/vpc_peerings_validator.py +2 -2
- tools/app_interface_reporter.py +4 -4
- tools/cli_commands/cost_report/cost_management_api.py +3 -3
- tools/cli_commands/cost_report/view.py +7 -6
- tools/cli_commands/erv2.py +1 -1
- tools/cli_commands/gpg_encrypt.py +4 -1
- tools/cli_commands/systems_and_tools.py +5 -1
- tools/qontract_cli.py +36 -21
- tools/sre_checkpoints/util.py +5 -3
- tools/template_validation.py +3 -1
- reconcile/gql_definitions/ocm_oidc_idp/__init__.py +0 -0
- reconcile/gql_definitions/ocm_subscription_labels/__init__.py +0 -0
- reconcile/jenkins/__init__.py +0 -0
- reconcile/jenkins/types.py +0 -77
- {qontract_reconcile-0.10.2.dev299.dist-info → qontract_reconcile-0.10.2.dev430.dist-info}/WHEEL +0 -0
- {qontract_reconcile-0.10.2.dev299.dist-info → qontract_reconcile-0.10.2.dev430.dist-info}/entry_points.txt +0 -0
reconcile/utils/oc_filters.py
CHANGED
|
@@ -19,19 +19,19 @@ class Namespace(Protocol):
|
|
|
19
19
|
NS = TypeVar("NS", bound=Namespace)
|
|
20
20
|
|
|
21
21
|
|
|
22
|
-
def filter_namespaces_by_cluster(
|
|
22
|
+
def filter_namespaces_by_cluster[NS: Namespace](
|
|
23
23
|
namespaces: Iterable[NS], cluster_names: Iterable[str]
|
|
24
24
|
) -> list[NS]:
|
|
25
25
|
return [n for n in namespaces if n.cluster.name in cluster_names]
|
|
26
26
|
|
|
27
27
|
|
|
28
|
-
def filter_namespaces_by_name(
|
|
28
|
+
def filter_namespaces_by_name[NS: Namespace](
|
|
29
29
|
namespaces: Iterable[NS], namespace_names: Iterable[str]
|
|
30
30
|
) -> list[NS]:
|
|
31
31
|
return [n for n in namespaces if n.name in namespace_names]
|
|
32
32
|
|
|
33
33
|
|
|
34
|
-
def filter_namespaces_by_cluster_and_namespace(
|
|
34
|
+
def filter_namespaces_by_cluster_and_namespace[NS: Namespace](
|
|
35
35
|
namespaces: Iterable[NS],
|
|
36
36
|
cluster_names: Iterable[str] | None,
|
|
37
37
|
namespace_names: Iterable[str] | None,
|
reconcile/utils/ocm/addons.py
CHANGED
reconcile/utils/ocm/base.py
CHANGED
|
@@ -141,16 +141,16 @@ class OCMClusterAWSOperatorRole(BaseModel):
|
|
|
141
141
|
|
|
142
142
|
|
|
143
143
|
class OCMAWSSTS(OCMClusterFlag):
|
|
144
|
-
role_arn: str | None
|
|
145
|
-
support_role_arn: str | None
|
|
146
|
-
oidc_endpoint_url: str | None
|
|
147
|
-
operator_iam_roles: list[OCMClusterAWSOperatorRole] | None
|
|
148
|
-
instance_iam_roles: dict[str, str] | None
|
|
149
|
-
operator_role_prefix: str | None
|
|
144
|
+
role_arn: str | None = None
|
|
145
|
+
support_role_arn: str | None = None
|
|
146
|
+
oidc_endpoint_url: str | None = None
|
|
147
|
+
operator_iam_roles: list[OCMClusterAWSOperatorRole] | None = None
|
|
148
|
+
instance_iam_roles: dict[str, str] | None = None
|
|
149
|
+
operator_role_prefix: str | None = None
|
|
150
150
|
|
|
151
151
|
|
|
152
152
|
class OCMClusterAWSSettings(BaseModel):
|
|
153
|
-
sts: OCMAWSSTS | None
|
|
153
|
+
sts: OCMAWSSTS | None = None
|
|
154
154
|
|
|
155
155
|
@property
|
|
156
156
|
def sts_enabled(self) -> bool:
|
|
@@ -215,6 +215,10 @@ class OCMExternalConfiguration(BaseModel):
|
|
|
215
215
|
syncsets: dict
|
|
216
216
|
|
|
217
217
|
|
|
218
|
+
class OCMExternalAuthConfig(BaseModel):
|
|
219
|
+
enabled: bool
|
|
220
|
+
|
|
221
|
+
|
|
218
222
|
PRODUCT_ID_OSD = "osd"
|
|
219
223
|
PRODUCT_ID_ROSA = "rosa"
|
|
220
224
|
|
|
@@ -260,19 +264,21 @@ class OCMCluster(BaseModel):
|
|
|
260
264
|
product: OCMModelLink
|
|
261
265
|
identity_providers: OCMCollectionLink
|
|
262
266
|
|
|
263
|
-
aws: OCMClusterAWSSettings | None
|
|
267
|
+
aws: OCMClusterAWSSettings | None = None
|
|
264
268
|
|
|
265
269
|
version: OCMClusterVersion
|
|
266
270
|
|
|
267
271
|
hypershift: OCMClusterFlag
|
|
268
272
|
|
|
269
|
-
console: OCMClusterConsole | None
|
|
273
|
+
console: OCMClusterConsole | None = None
|
|
274
|
+
|
|
275
|
+
api: OCMClusterAPI | None = None
|
|
270
276
|
|
|
271
|
-
|
|
277
|
+
dns: OCMClusterDns | None = None
|
|
272
278
|
|
|
273
|
-
|
|
279
|
+
external_configuration: OCMExternalConfiguration | None = None
|
|
274
280
|
|
|
275
|
-
|
|
281
|
+
external_auth_config: OCMExternalAuthConfig | None = None
|
|
276
282
|
|
|
277
283
|
def minor_version(self) -> str:
|
|
278
284
|
version_info = parse_semver(self.version.raw_id)
|
|
@@ -315,6 +321,10 @@ class OCMCluster(BaseModel):
|
|
|
315
321
|
def base_domain(self) -> str | None:
|
|
316
322
|
return self.dns.base_domain if self.dns else None
|
|
317
323
|
|
|
324
|
+
@property
|
|
325
|
+
def external_auth_enabled(self) -> bool:
|
|
326
|
+
return self.external_auth_config.enabled if self.external_auth_config else False
|
|
327
|
+
|
|
318
328
|
|
|
319
329
|
class OCMLabel(BaseModel):
|
|
320
330
|
"""
|
|
@@ -560,15 +570,12 @@ class OCMOIdentityProviderGithub(OCMOIdentityProvider):
|
|
|
560
570
|
)
|
|
561
571
|
|
|
562
572
|
|
|
563
|
-
class OCMOIdentityProviderOidcOpenIdClaims(BaseModel):
|
|
573
|
+
class OCMOIdentityProviderOidcOpenIdClaims(BaseModel, frozen=True):
|
|
564
574
|
email: list[str]
|
|
565
|
-
name: list[str]
|
|
575
|
+
name: list[str] = []
|
|
566
576
|
preferred_username: list[str]
|
|
567
577
|
groups: list[str] = []
|
|
568
578
|
|
|
569
|
-
class Config:
|
|
570
|
-
frozen = True
|
|
571
|
-
|
|
572
579
|
|
|
573
580
|
class OCMOIdentityProviderOidcOpenId(BaseModel):
|
|
574
581
|
client_id: str
|
|
@@ -608,11 +615,11 @@ class OCMAddonUpgradePolicy(BaseModel):
|
|
|
608
615
|
id: str
|
|
609
616
|
addon_id: str
|
|
610
617
|
cluster_id: str
|
|
611
|
-
next_run: str | None
|
|
612
|
-
schedule: str | None
|
|
618
|
+
next_run: str | None = None
|
|
619
|
+
schedule: str | None = None
|
|
613
620
|
schedule_type: str
|
|
614
621
|
version: str
|
|
615
|
-
state: str | None
|
|
622
|
+
state: str | None = None
|
|
616
623
|
|
|
617
624
|
|
|
618
625
|
def build_label_container(
|
|
@@ -42,7 +42,7 @@ def add_identity_provider(
|
|
|
42
42
|
)
|
|
43
43
|
ocm_api.post(
|
|
44
44
|
api_path=ocm_cluster.identity_providers.href,
|
|
45
|
-
data=idp.
|
|
45
|
+
data=idp.model_dump(by_alias=True, exclude_none=True),
|
|
46
46
|
)
|
|
47
47
|
|
|
48
48
|
|
|
@@ -55,7 +55,7 @@ def update_identity_provider(
|
|
|
55
55
|
raise ValueError(f"IDP {idp.name} does not have a href!")
|
|
56
56
|
ocm_api.patch(
|
|
57
57
|
api_path=idp.href,
|
|
58
|
-
data=idp.
|
|
58
|
+
data=idp.model_dump(by_alias=True, exclude_none=True, exclude={"name"}),
|
|
59
59
|
)
|
|
60
60
|
|
|
61
61
|
|
reconcile/utils/ocm/labels.py
CHANGED
|
@@ -159,7 +159,7 @@ def build_container_for_prefix(
|
|
|
159
159
|
|
|
160
160
|
return LabelContainer(
|
|
161
161
|
labels={
|
|
162
|
-
strip_prefix_if_needed(label.key): label.
|
|
162
|
+
strip_prefix_if_needed(label.key): label.model_copy(
|
|
163
163
|
update={"key": strip_prefix_if_needed(label.key)}
|
|
164
164
|
)
|
|
165
165
|
for label in container.labels.values()
|
reconcile/utils/ocm/ocm.py
CHANGED
|
@@ -21,7 +21,7 @@ from reconcile.utils.ocm_base_client import (
|
|
|
21
21
|
from reconcile.utils.secret_reader import SecretReader
|
|
22
22
|
|
|
23
23
|
if TYPE_CHECKING:
|
|
24
|
-
from collections.abc import Mapping
|
|
24
|
+
from collections.abc import Iterable, Mapping, MutableMapping
|
|
25
25
|
|
|
26
26
|
from reconcile.ocm.types import OCMSpec
|
|
27
27
|
|
|
@@ -83,13 +83,13 @@ class OCM:
|
|
|
83
83
|
|
|
84
84
|
def __init__(
|
|
85
85
|
self,
|
|
86
|
-
name,
|
|
87
|
-
org_id,
|
|
86
|
+
name: str,
|
|
87
|
+
org_id: str,
|
|
88
88
|
ocm_env: str,
|
|
89
89
|
ocm_client: OCMBaseClient,
|
|
90
|
-
init_provision_shards=False,
|
|
91
|
-
init_addons=False,
|
|
92
|
-
init_version_gates=False,
|
|
90
|
+
init_provision_shards: bool = False,
|
|
91
|
+
init_addons: bool = False,
|
|
92
|
+
init_version_gates: bool = False,
|
|
93
93
|
product_portfolio: OCMProductPortfolio | None = None,
|
|
94
94
|
):
|
|
95
95
|
"""Initiates access token and gets clusters information."""
|
|
@@ -130,7 +130,7 @@ class OCM:
|
|
|
130
130
|
and cluster["product"]["id"] in self.product_portfolio.product_names
|
|
131
131
|
)
|
|
132
132
|
|
|
133
|
-
def _init_clusters(self, init_provision_shards: bool):
|
|
133
|
+
def _init_clusters(self, init_provision_shards: bool) -> None:
|
|
134
134
|
api = f"{CS_API_BASE}/v1/clusters"
|
|
135
135
|
product_csv = ",".join([f"'{p}'" for p in self.product_portfolio.product_names])
|
|
136
136
|
params = {
|
|
@@ -168,19 +168,19 @@ class OCM:
|
|
|
168
168
|
spec = impl.get_ocm_spec(self.ocm_api, cluster, init_provision_shards)
|
|
169
169
|
return spec
|
|
170
170
|
|
|
171
|
-
def create_cluster(self, name: str, cluster: OCMSpec, dry_run: bool):
|
|
171
|
+
def create_cluster(self, name: str, cluster: OCMSpec, dry_run: bool) -> None:
|
|
172
172
|
impl = self.get_product_impl(cluster.spec.product, cluster.spec.hypershift)
|
|
173
173
|
impl.create_cluster(self.ocm_api, self.org_id, name, cluster, dry_run)
|
|
174
174
|
|
|
175
175
|
def update_cluster(
|
|
176
|
-
self, cluster_name: str, update_spec: Mapping[str, Any], dry_run=False
|
|
177
|
-
):
|
|
176
|
+
self, cluster_name: str, update_spec: Mapping[str, Any], dry_run: bool = False
|
|
177
|
+
) -> None:
|
|
178
178
|
cluster = self.clusters[cluster_name]
|
|
179
179
|
cluster_id = self.cluster_ids[cluster_name]
|
|
180
180
|
impl = self.get_product_impl(cluster.spec.product, cluster.spec.hypershift)
|
|
181
181
|
impl.update_cluster(self.ocm_api, cluster_id, update_spec, dry_run)
|
|
182
182
|
|
|
183
|
-
def get_group_if_exists(self, cluster, group_id):
|
|
183
|
+
def get_group_if_exists(self, cluster: str, group_id: str) -> dict[str, Any] | None:
|
|
184
184
|
"""Returns a list of users in a group in a cluster.
|
|
185
185
|
If the group does not exist, None will be returned.
|
|
186
186
|
|
|
@@ -202,7 +202,7 @@ class OCM:
|
|
|
202
202
|
users = self._get_json(api).get("items", [])
|
|
203
203
|
return {"users": [u["id"] for u in users]}
|
|
204
204
|
|
|
205
|
-
def add_user_to_group(self, cluster, group_id, user):
|
|
205
|
+
def add_user_to_group(self, cluster: str, group_id: str, user: str) -> None:
|
|
206
206
|
"""
|
|
207
207
|
Adds a user to a group in a cluster.
|
|
208
208
|
|
|
@@ -218,7 +218,7 @@ class OCM:
|
|
|
218
218
|
api = f"{CS_API_BASE}/v1/clusters/{cluster_id}/" + f"groups/{group_id}/users"
|
|
219
219
|
self._post(api, {"id": user})
|
|
220
220
|
|
|
221
|
-
def del_user_from_group(self, cluster, group_id, user_id):
|
|
221
|
+
def del_user_from_group(self, cluster: str, group_id: str, user_id: str) -> None:
|
|
222
222
|
"""Deletes a user from a group in a cluster.
|
|
223
223
|
|
|
224
224
|
:param cluster: cluster name
|
|
@@ -250,7 +250,9 @@ class OCM:
|
|
|
250
250
|
switch_role_link = role_grants[0][-1]
|
|
251
251
|
return awsh.get_account_uid_from_role_link(switch_role_link)
|
|
252
252
|
|
|
253
|
-
def get_aws_infrastructure_access_role_grants(
|
|
253
|
+
def get_aws_infrastructure_access_role_grants(
|
|
254
|
+
self, cluster: str
|
|
255
|
+
) -> list[tuple[str, str, str, str]]:
|
|
254
256
|
"""Returns a list of AWS users (ARN, access level)
|
|
255
257
|
who have AWS infrastructure access in a cluster.
|
|
256
258
|
|
|
@@ -272,8 +274,8 @@ class OCM:
|
|
|
272
274
|
]
|
|
273
275
|
|
|
274
276
|
def get_aws_infrastructure_access_terraform_assume_role(
|
|
275
|
-
self, cluster, tf_account_id, tf_user
|
|
276
|
-
):
|
|
277
|
+
self, cluster: str, tf_account_id: str, tf_user: str | None
|
|
278
|
+
) -> str | None:
|
|
277
279
|
role_grants = self.get_aws_infrastructure_access_role_grants(cluster)
|
|
278
280
|
user_arn = f"arn:aws:iam::{tf_account_id}:user/{tf_user}"
|
|
279
281
|
for arn, role_id, _, console_url in role_grants:
|
|
@@ -288,9 +290,11 @@ class OCM:
|
|
|
288
290
|
role_name = role.replace("roleName=", "")
|
|
289
291
|
return f"arn:aws:iam::{role_account_id}:role/{role_name}"
|
|
290
292
|
|
|
293
|
+
return None
|
|
294
|
+
|
|
291
295
|
def add_user_to_aws_infrastructure_access_role_grants(
|
|
292
|
-
self, cluster, user_arn, access_level
|
|
293
|
-
):
|
|
296
|
+
self, cluster: str, user_arn: str, access_level: str
|
|
297
|
+
) -> None:
|
|
294
298
|
"""
|
|
295
299
|
Adds a user to AWS infrastructure access in a cluster.
|
|
296
300
|
|
|
@@ -310,8 +314,8 @@ class OCM:
|
|
|
310
314
|
self._post(api, {"user_arn": user_arn, "role": {"id": access_level}})
|
|
311
315
|
|
|
312
316
|
def del_user_from_aws_infrastructure_access_role_grants(
|
|
313
|
-
self, cluster, user_arn, access_level
|
|
314
|
-
):
|
|
317
|
+
self, cluster: str, user_arn: str, access_level: str
|
|
318
|
+
) -> None:
|
|
315
319
|
"""
|
|
316
320
|
Deletes a user from AWS infrastructure access in a cluster.
|
|
317
321
|
|
|
@@ -375,7 +379,9 @@ class OCM:
|
|
|
375
379
|
|
|
376
380
|
return results
|
|
377
381
|
|
|
378
|
-
def create_external_configuration_label(
|
|
382
|
+
def create_external_configuration_label(
|
|
383
|
+
self, cluster: str, label: dict[str, str]
|
|
384
|
+
) -> None:
|
|
379
385
|
"""Creates a new External Configuration label
|
|
380
386
|
|
|
381
387
|
:param cluster: cluster name
|
|
@@ -390,7 +396,9 @@ class OCM:
|
|
|
390
396
|
)
|
|
391
397
|
self._post(api, label)
|
|
392
398
|
|
|
393
|
-
def delete_external_configuration_label(
|
|
399
|
+
def delete_external_configuration_label(
|
|
400
|
+
self, cluster: str, label: Mapping[str, str]
|
|
401
|
+
) -> None:
|
|
394
402
|
"""Deletes an existing External Configuration label
|
|
395
403
|
|
|
396
404
|
:param cluster: cluster name
|
|
@@ -414,14 +422,9 @@ class OCM:
|
|
|
414
422
|
)
|
|
415
423
|
self._delete(api)
|
|
416
424
|
|
|
417
|
-
def get_machine_pools(self, cluster):
|
|
418
|
-
"""Returns a list of details of Machine Pools
|
|
419
|
-
|
|
420
|
-
:param cluster: cluster name
|
|
421
|
-
|
|
422
|
-
:type cluster: string
|
|
423
|
-
"""
|
|
424
|
-
results = []
|
|
425
|
+
def get_machine_pools(self, cluster: str) -> list[dict[str, Any]]:
|
|
426
|
+
"""Returns a list of details of Machine Pools"""
|
|
427
|
+
results: list[dict[str, Any]] = []
|
|
425
428
|
cluster_id = self.cluster_ids.get(cluster)
|
|
426
429
|
if not cluster_id:
|
|
427
430
|
return results
|
|
@@ -436,7 +439,7 @@ class OCM:
|
|
|
436
439
|
|
|
437
440
|
return results
|
|
438
441
|
|
|
439
|
-
def create_machine_pool(self, cluster, spec):
|
|
442
|
+
def create_machine_pool(self, cluster: str, spec: Mapping[str, Any]) -> None:
|
|
440
443
|
"""Creates a new Machine Pool
|
|
441
444
|
|
|
442
445
|
:param cluster: cluster name
|
|
@@ -449,7 +452,7 @@ class OCM:
|
|
|
449
452
|
api = f"{CS_API_BASE}/v1/clusters/{cluster_id}/machine_pools"
|
|
450
453
|
self._post(api, spec)
|
|
451
454
|
|
|
452
|
-
def update_machine_pool(self, cluster, spec):
|
|
455
|
+
def update_machine_pool(self, cluster: str, spec: MutableMapping[str, Any]) -> None:
|
|
453
456
|
"""Updates an existing Machine Pool
|
|
454
457
|
|
|
455
458
|
:param cluster: cluster name
|
|
@@ -460,7 +463,7 @@ class OCM:
|
|
|
460
463
|
"""
|
|
461
464
|
cluster_id = self.cluster_ids[cluster]
|
|
462
465
|
machine_pool_id = spec["id"]
|
|
463
|
-
labels = spec.get("labels", {})
|
|
466
|
+
labels: dict[str, str] = spec.get("labels", {})
|
|
464
467
|
spec["labels"] = labels
|
|
465
468
|
api = (
|
|
466
469
|
f"{CS_API_BASE}/v1/clusters/{cluster_id}/machine_pools/"
|
|
@@ -468,7 +471,7 @@ class OCM:
|
|
|
468
471
|
)
|
|
469
472
|
self._patch(api, spec)
|
|
470
473
|
|
|
471
|
-
def delete_machine_pool(self, cluster, spec):
|
|
474
|
+
def delete_machine_pool(self, cluster: str, spec: Mapping[str, Any]) -> None:
|
|
472
475
|
"""Deletes an existing Machine Pool
|
|
473
476
|
|
|
474
477
|
:param cluster: cluster name
|
|
@@ -485,21 +488,21 @@ class OCM:
|
|
|
485
488
|
)
|
|
486
489
|
self._delete(api)
|
|
487
490
|
|
|
488
|
-
def get_node_pools(self, cluster):
|
|
491
|
+
def get_node_pools(self, cluster: str) -> list[dict[str, Any]]:
|
|
489
492
|
"""Returns a list of details of Node Pools
|
|
490
493
|
|
|
491
494
|
:param cluster: cluster name
|
|
492
495
|
|
|
493
496
|
:type cluster: string
|
|
494
497
|
"""
|
|
495
|
-
results = []
|
|
498
|
+
results: list[dict[str, Any]] = []
|
|
496
499
|
cluster_id = self.cluster_ids.get(cluster)
|
|
497
500
|
if not cluster_id:
|
|
498
501
|
return results
|
|
499
502
|
|
|
500
503
|
return get_node_pools(self._ocm_client, cluster_id)
|
|
501
504
|
|
|
502
|
-
def delete_node_pool(self, cluster, spec):
|
|
505
|
+
def delete_node_pool(self, cluster: str, spec: Mapping[str, Any]) -> None:
|
|
503
506
|
"""Deletes an existing Node Pool
|
|
504
507
|
|
|
505
508
|
:param cluster: cluster name
|
|
@@ -513,7 +516,7 @@ class OCM:
|
|
|
513
516
|
api = f"{CS_API_BASE}/v1/clusters/{cluster_id}/node_pools/" + f"{node_pool_id}"
|
|
514
517
|
self._delete(api)
|
|
515
518
|
|
|
516
|
-
def create_node_pool(self, cluster, spec):
|
|
519
|
+
def create_node_pool(self, cluster: str, spec: Mapping[str, Any]) -> None:
|
|
517
520
|
"""Creates a new Node Pool
|
|
518
521
|
|
|
519
522
|
:param cluster: cluster name
|
|
@@ -526,7 +529,7 @@ class OCM:
|
|
|
526
529
|
api = f"{CS_API_BASE}/v1/clusters/{cluster_id}/node_pools"
|
|
527
530
|
self._post(api, spec)
|
|
528
531
|
|
|
529
|
-
def update_node_pool(self, cluster, spec):
|
|
532
|
+
def update_node_pool(self, cluster: str, spec: MutableMapping[str, Any]) -> None:
|
|
530
533
|
"""Updates an existing Node Pool
|
|
531
534
|
|
|
532
535
|
:param cluster: cluster name
|
|
@@ -537,19 +540,19 @@ class OCM:
|
|
|
537
540
|
"""
|
|
538
541
|
cluster_id = self.cluster_ids[cluster]
|
|
539
542
|
node_pool_id = spec["id"]
|
|
540
|
-
labels = spec.get("labels", {})
|
|
543
|
+
labels: dict[str, str] = spec.get("labels", {})
|
|
541
544
|
spec["labels"] = labels
|
|
542
545
|
api = f"{CS_API_BASE}/v1/clusters/{cluster_id}/node_pools/" + f"{node_pool_id}"
|
|
543
546
|
self._patch(api, spec)
|
|
544
547
|
|
|
545
|
-
def get_additional_routers(self, cluster):
|
|
548
|
+
def get_additional_routers(self, cluster: str) -> list[dict[str, Any]]:
|
|
546
549
|
"""Returns a list of Additional Application Routers
|
|
547
550
|
|
|
548
551
|
:param cluster: cluster name
|
|
549
552
|
|
|
550
553
|
:type cluster: string
|
|
551
554
|
"""
|
|
552
|
-
results = []
|
|
555
|
+
results: list[dict[str, Any]] = []
|
|
553
556
|
cluster_id = self.cluster_ids.get(cluster)
|
|
554
557
|
if not cluster_id:
|
|
555
558
|
return results
|
|
@@ -567,7 +570,7 @@ class OCM:
|
|
|
567
570
|
|
|
568
571
|
return results
|
|
569
572
|
|
|
570
|
-
def create_additional_router(self, cluster, spec):
|
|
573
|
+
def create_additional_router(self, cluster: str, spec: Mapping[str, Any]) -> None:
|
|
571
574
|
"""Creates a new Additional Application Router
|
|
572
575
|
|
|
573
576
|
:param cluster: cluster name
|
|
@@ -580,7 +583,7 @@ class OCM:
|
|
|
580
583
|
api = f"{CS_API_BASE}/v1/clusters/{cluster_id}/ingresses"
|
|
581
584
|
self._post(api, spec)
|
|
582
585
|
|
|
583
|
-
def delete_additional_router(self, cluster, spec):
|
|
586
|
+
def delete_additional_router(self, cluster: str, spec: Mapping[str, Any]) -> None:
|
|
584
587
|
"""Deletes an existing Additional Application Router
|
|
585
588
|
|
|
586
589
|
:param cluster: cluster name
|
|
@@ -594,19 +597,19 @@ class OCM:
|
|
|
594
597
|
api = f"{CS_API_BASE}/v1/clusters/{cluster_id}/" + f"ingresses/{router_id}"
|
|
595
598
|
self._delete(api)
|
|
596
599
|
|
|
597
|
-
def _init_addons(self):
|
|
600
|
+
def _init_addons(self) -> None:
|
|
598
601
|
"""Returns a list of Addons"""
|
|
599
602
|
api = f"{CS_API_BASE}/v1/addons"
|
|
600
603
|
self.addons = self._get_json(api).get("items", [])
|
|
601
604
|
|
|
602
|
-
def _init_version_gates(self):
|
|
605
|
+
def _init_version_gates(self) -> None:
|
|
603
606
|
"""Returns a list of version gates"""
|
|
604
607
|
if self.version_gates:
|
|
605
608
|
return
|
|
606
609
|
api = f"{CS_API_BASE}/v1/version_gates"
|
|
607
610
|
self.version_gates = self._get_json(api).get("items", [])
|
|
608
611
|
|
|
609
|
-
def get_addon(self, id):
|
|
612
|
+
def get_addon(self, id: str) -> dict[str, Any] | None:
|
|
610
613
|
for addon in self.addons:
|
|
611
614
|
addon_id = addon["id"]
|
|
612
615
|
if id == addon_id:
|
|
@@ -652,7 +655,7 @@ class OCM:
|
|
|
652
655
|
|
|
653
656
|
return results
|
|
654
657
|
|
|
655
|
-
def install_addon(self, cluster, spec):
|
|
658
|
+
def install_addon(self, cluster: str, spec: MutableMapping[str, Any]) -> None:
|
|
656
659
|
"""Installs an addon on a cluster
|
|
657
660
|
|
|
658
661
|
:param cluster: cluster name
|
|
@@ -714,21 +717,28 @@ class OCM:
|
|
|
714
717
|
return ret_items
|
|
715
718
|
return responses[0]
|
|
716
719
|
|
|
717
|
-
def _post(
|
|
720
|
+
def _post(
|
|
721
|
+
self,
|
|
722
|
+
api: str,
|
|
723
|
+
data: Mapping[str, Any] | None = None,
|
|
724
|
+
params: Mapping[str, str] | None = None,
|
|
725
|
+
) -> Any:
|
|
718
726
|
return self._ocm_client.post(
|
|
719
727
|
api_path=api,
|
|
720
728
|
data=data,
|
|
721
729
|
params=params,
|
|
722
730
|
)
|
|
723
731
|
|
|
724
|
-
def _patch(
|
|
732
|
+
def _patch(
|
|
733
|
+
self, api: str, data: Mapping[str, Any], params: Mapping[str, str] | None = None
|
|
734
|
+
) -> None:
|
|
725
735
|
return self._ocm_client.patch(
|
|
726
736
|
api_path=api,
|
|
727
737
|
data=data,
|
|
728
738
|
params=params,
|
|
729
739
|
)
|
|
730
740
|
|
|
731
|
-
def _delete(self, api):
|
|
741
|
+
def _delete(self, api: str) -> None:
|
|
732
742
|
return self._ocm_client.delete(
|
|
733
743
|
api_path=api,
|
|
734
744
|
)
|
|
@@ -762,14 +772,14 @@ class OCMMap:
|
|
|
762
772
|
|
|
763
773
|
def __init__(
|
|
764
774
|
self,
|
|
765
|
-
clusters=None,
|
|
766
|
-
namespaces=None,
|
|
767
|
-
ocms=None,
|
|
768
|
-
integration="",
|
|
769
|
-
settings=None,
|
|
770
|
-
init_provision_shards=False,
|
|
771
|
-
init_addons=False,
|
|
772
|
-
init_version_gates=False,
|
|
775
|
+
clusters: Iterable[Mapping[str, Any]] | None = None,
|
|
776
|
+
namespaces: Iterable[Mapping[str, Any]] | None = None,
|
|
777
|
+
ocms: Iterable[Mapping[str, Any]] | None = None,
|
|
778
|
+
integration: str = "",
|
|
779
|
+
settings: Mapping[str, Any] | None = None,
|
|
780
|
+
init_provision_shards: bool = False,
|
|
781
|
+
init_addons: bool = False,
|
|
782
|
+
init_version_gates: bool = False,
|
|
773
783
|
product_portfolio: OCMProductPortfolio | None = None,
|
|
774
784
|
) -> None:
|
|
775
785
|
"""Initiates OCM instances for each OCM referenced in a cluster."""
|
|
@@ -817,12 +827,12 @@ class OCMMap:
|
|
|
817
827
|
|
|
818
828
|
def init_ocm_client_from_cluster(
|
|
819
829
|
self,
|
|
820
|
-
cluster_info,
|
|
821
|
-
init_provision_shards,
|
|
822
|
-
init_addons,
|
|
823
|
-
init_version_gates,
|
|
830
|
+
cluster_info: Mapping[str, Any],
|
|
831
|
+
init_provision_shards: bool,
|
|
832
|
+
init_addons: bool,
|
|
833
|
+
init_version_gates: bool,
|
|
824
834
|
product_portfolio: OCMProductPortfolio | None = None,
|
|
825
|
-
):
|
|
835
|
+
) -> None:
|
|
826
836
|
if self.cluster_disabled(cluster_info):
|
|
827
837
|
return
|
|
828
838
|
cluster_name = cluster_info["name"]
|
|
@@ -842,12 +852,12 @@ class OCMMap:
|
|
|
842
852
|
|
|
843
853
|
def init_ocm_client(
|
|
844
854
|
self,
|
|
845
|
-
ocm_info,
|
|
846
|
-
init_provision_shards,
|
|
847
|
-
init_addons,
|
|
848
|
-
init_version_gates,
|
|
855
|
+
ocm_info: Mapping[str, Any],
|
|
856
|
+
init_provision_shards: bool,
|
|
857
|
+
init_addons: bool,
|
|
858
|
+
init_version_gates: bool,
|
|
849
859
|
product_portfolio: OCMProductPortfolio | None = None,
|
|
850
|
-
):
|
|
860
|
+
) -> None:
|
|
851
861
|
"""
|
|
852
862
|
Initiate OCM client.
|
|
853
863
|
Gets the OCM information and initiates an OCM client.
|
|
@@ -901,7 +911,7 @@ class OCMMap:
|
|
|
901
911
|
"""Get list of OCM instance names initiated in the OCM map."""
|
|
902
912
|
return list(self.ocm_map.keys())
|
|
903
913
|
|
|
904
|
-
def cluster_disabled(self, cluster_info):
|
|
914
|
+
def cluster_disabled(self, cluster_info: Mapping[str, Any]) -> bool:
|
|
905
915
|
"""
|
|
906
916
|
Checks if the calling integration is disabled in this cluster.
|
|
907
917
|
|
|
@@ -918,7 +928,7 @@ class OCMMap:
|
|
|
918
928
|
|
|
919
929
|
return False
|
|
920
930
|
|
|
921
|
-
def get(self, cluster) -> OCM:
|
|
931
|
+
def get(self, cluster: str) -> OCM:
|
|
922
932
|
"""
|
|
923
933
|
Gets an OCM instance by cluster.
|
|
924
934
|
|
reconcile/utils/ocm/products.py
CHANGED
|
@@ -47,6 +47,7 @@ SPEC_ATTR_MULTI_AZ = "multi_az"
|
|
|
47
47
|
SPEC_ATTR_HYPERSHIFT = "hypershift"
|
|
48
48
|
SPEC_ATTR_SUBNET_IDS = "subnet_ids"
|
|
49
49
|
SPEC_ATTR_AVAILABILITY_ZONES = "availability_zones"
|
|
50
|
+
SPEC_ATTR_FIPS = "fips"
|
|
50
51
|
|
|
51
52
|
SPEC_ATTR_NETWORK = "network"
|
|
52
53
|
IGNORE_NETWORK_TYPE_ATTR = "type"
|
|
@@ -177,10 +178,11 @@ class OCMProductOsd(OCMProduct):
|
|
|
177
178
|
],
|
|
178
179
|
provision_shard_id=provision_shard_id,
|
|
179
180
|
hypershift=cluster["hypershift"]["enabled"],
|
|
181
|
+
fips=cluster.get("fips") or False,
|
|
180
182
|
)
|
|
181
183
|
|
|
182
184
|
if not cluster["ccs"]["enabled"]:
|
|
183
|
-
cluster_spec_data = spec.
|
|
185
|
+
cluster_spec_data = spec.model_dump()
|
|
184
186
|
cluster_spec_data["storage"] = (
|
|
185
187
|
cluster["storage_quota"]["value"] // BYTES_IN_GIGABYTE
|
|
186
188
|
)
|
|
@@ -227,7 +229,7 @@ class OCMProductOsd(OCMProduct):
|
|
|
227
229
|
"compute_machine_type": {"id": default_machine_pool.instance_type},
|
|
228
230
|
}
|
|
229
231
|
if default_machine_pool.autoscale is not None:
|
|
230
|
-
spec["autoscale_compute"] = default_machine_pool.autoscale.
|
|
232
|
+
spec["autoscale_compute"] = default_machine_pool.autoscale.model_dump()
|
|
231
233
|
else:
|
|
232
234
|
spec["compute"] = default_machine_pool.replicas
|
|
233
235
|
return spec
|
|
@@ -257,6 +259,7 @@ class OCMProductOsd(OCMProduct):
|
|
|
257
259
|
if (duwm := cluster.spec.disable_user_workload_monitoring) is not None
|
|
258
260
|
else True
|
|
259
261
|
),
|
|
262
|
+
"fips": cluster.spec.fips,
|
|
260
263
|
}
|
|
261
264
|
|
|
262
265
|
# Workaround to enable type checks.
|
|
@@ -426,6 +429,7 @@ class OCMProductRosa(OCMProduct):
|
|
|
426
429
|
subnet_ids=cluster["aws"].get("subnet_ids"),
|
|
427
430
|
availability_zones=cluster["nodes"].get("availability_zones"),
|
|
428
431
|
oidc_endpoint_url=oidc_endpoint_url,
|
|
432
|
+
fips=cluster.get("fips") or False,
|
|
429
433
|
)
|
|
430
434
|
|
|
431
435
|
machine_pools = [
|
|
@@ -470,7 +474,7 @@ class OCMProductRosa(OCMProduct):
|
|
|
470
474
|
"compute_machine_type": {"id": default_machine_pool.instance_type},
|
|
471
475
|
}
|
|
472
476
|
if default_machine_pool.autoscale is not None:
|
|
473
|
-
spec["autoscale_compute"] = default_machine_pool.autoscale.
|
|
477
|
+
spec["autoscale_compute"] = default_machine_pool.autoscale.model_dump()
|
|
474
478
|
else:
|
|
475
479
|
spec["compute"] = default_machine_pool.replicas
|
|
476
480
|
return spec
|
|
@@ -513,6 +517,7 @@ class OCMProductRosa(OCMProduct):
|
|
|
513
517
|
if (duwm := cluster.spec.disable_user_workload_monitoring) is not None
|
|
514
518
|
else True
|
|
515
519
|
),
|
|
520
|
+
"fips": cluster.spec.fips,
|
|
516
521
|
}
|
|
517
522
|
|
|
518
523
|
provision_shard_id = cluster.spec.provision_shard_id
|
|
@@ -701,6 +706,7 @@ class OCMProductHypershift(OCMProduct):
|
|
|
701
706
|
availability_zones=cluster["nodes"].get("availability_zones"),
|
|
702
707
|
hypershift=cluster["hypershift"]["enabled"],
|
|
703
708
|
oidc_endpoint_url=oidc_endpoint_url,
|
|
709
|
+
fips=cluster.get("fips") or False,
|
|
704
710
|
)
|
|
705
711
|
|
|
706
712
|
network = OCMClusterNetwork(
|