qontract-reconcile 0.10.1rc997__py3-none-any.whl → 0.10.1rc999__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: qontract-reconcile
3
- Version: 0.10.1rc997
3
+ Version: 0.10.1rc999
4
4
  Summary: Collection of tools to reconcile services with their desired state as defined in the app-interface DB.
5
5
  Home-page: https://github.com/app-sre/qontract-reconcile
6
6
  Author: Red Hat App-SRE Team
@@ -75,7 +75,7 @@ reconcile/openshift_resources.py,sha256=I2nO_C37mG3rfyGrd4cGwN3mVseVGuTAHAyhFzLy
75
75
  reconcile/openshift_resources_base.py,sha256=Seh4T8oA_JO-g0Z5TODDtL5cyRj-o7bmk6-eOmDAL4Q,40751
76
76
  reconcile/openshift_rolebindings.py,sha256=9mlJ2FjWUoH-rsjtasreA_hV-K5Z_YR00qR_RR60OZM,6555
77
77
  reconcile/openshift_routes.py,sha256=fXvuPSjcjVw1X3j2EQvUAdbOepmIFdKk-M3qP8QzPiw,1075
78
- reconcile/openshift_saas_deploy.py,sha256=b6Og_SlQ-ptYvTBNycK4Z5yP9bbvMXiY39R90TfUfZU,12728
78
+ reconcile/openshift_saas_deploy.py,sha256=UZlm29JujJVS3MzSm6uehlC3y-jZxl6WVwMeKRdN11U,12773
79
79
  reconcile/openshift_saas_deploy_change_tester.py,sha256=FfXrx_JloAlWeJVsJLIQPqFQ7OoBkaB2TgJJXlNZNCM,8796
80
80
  reconcile/openshift_saas_deploy_trigger_base.py,sha256=m7aqYEZUM-vr3EBw-hIbz1rHpXZNxs_BAJv3ndfvnAQ,14039
81
81
  reconcile/openshift_saas_deploy_trigger_cleaner.py,sha256=roLyVAVntaQptKaZbnN1LyLvCA8fyvqELfjU6M8xfeY,3511
@@ -243,6 +243,7 @@ reconcile/gql_definitions/common/app_interface_dms_settings.py,sha256=h-N7-XGpmH
243
243
  reconcile/gql_definitions/common/app_interface_repo_settings.py,sha256=rud0rz9NIFF-h1fFdk3MnwGmx73rhwrn1taN_HefvyU,1754
244
244
  reconcile/gql_definitions/common/app_interface_state_settings.py,sha256=VXIK0Hmyv6GTShI86IGkjxyHGwufqUBAh617XKUAKaI,2507
245
245
  reconcile/gql_definitions/common/app_interface_vault_settings.py,sha256=w8quvdG0cSq71ZyJokPPp7MyMpoDb6-HLQ3o9JHVGRQ,1771
246
+ reconcile/gql_definitions/common/app_quay_repos_escalation_policies.py,sha256=Nnl5ZSHukf0mux_Kfu_qSsTCQ6e9guytZTAApMRWz6Y,3050
246
247
  reconcile/gql_definitions/common/aws_vpc_requests.py,sha256=2lpyy-QSfHPSTvV_zbnqzqUoFzVNl-CJDmoqd_zVSX4,2366
247
248
  reconcile/gql_definitions/common/aws_vpcs.py,sha256=Dss9dQ3xagnz3Ltg1e9mtG2PAmQGBbUzKCmmzvuN28s,1892
248
249
  reconcile/gql_definitions/common/clusters.py,sha256=Dr5AsSsTuqjAxkI9fU0fdiaP6u5qkmRpkkCcYDnU584,21868
@@ -261,7 +262,7 @@ reconcile/gql_definitions/common/pgp_reencryption_settings.py,sha256=NPLmO6J-zSu
261
262
  reconcile/gql_definitions/common/pipeline_providers.py,sha256=JJgmmghqLIwjKOdcWYHPnf4PDgAq4GF7046i0ozrqgI,9127
262
263
  reconcile/gql_definitions/common/quay_instances.py,sha256=toBkdYYVTmEafezAHZKgaW-mQ29xEW6jeronzsAlNyI,1786
263
264
  reconcile/gql_definitions/common/reserved_networks.py,sha256=yP9qSQCaSQcva-ZgTnZp09qH27ur5_qK080ToIs04MY,2560
264
- reconcile/gql_definitions/common/saas_files.py,sha256=O57zDNuEfW3MKWdqEjhHNIsvHmZdrQ9fn1TAeAcLivk,16594
265
+ reconcile/gql_definitions/common/saas_files.py,sha256=JZdFKBygaZVxGwBUYMki9EbnsGdmfmxuAreMZ3dchwo,16702
265
266
  reconcile/gql_definitions/common/saas_target_namespaces.py,sha256=4VYP2VbwY8WVwtSFk2-jsUNhSmRD3X4FWKxetOKvmd0,2835
266
267
  reconcile/gql_definitions/common/saasherder_settings.py,sha256=nqQLcMwYxLseqq0BEcVvmrpIj2eQq0h8XDSpLN6GGCw,1793
267
268
  reconcile/gql_definitions/common/slack_workspaces.py,sha256=2o0kgi4QiaRuNmZJnc_By4F6NsKIdRaXkrufRQw7Nok,1753
@@ -592,6 +593,7 @@ reconcile/typed_queries/app_interface_deadmanssnitch_settings.py,sha256=_PpC3IM_
592
593
  reconcile/typed_queries/app_interface_repo_url.py,sha256=9fhgWihjWNYOmK65irBWw9jdm7YPJNUWqZC1Ez__PFc,578
593
594
  reconcile/typed_queries/app_interface_state_settings.py,sha256=GdtxrjKs6JONthBzXJO66wHx80v3YyHvbZScj0XFM1Q,447
594
595
  reconcile/typed_queries/app_interface_vault_settings.py,sha256=ffkKVDD5cukQWOorUIrGvpcVr3lCbUHRIz0HWX_h7gI,715
596
+ reconcile/typed_queries/app_quay_repos_escalation_policies.py,sha256=qpO9z9ev2RSH8sdZprLxhhrrbI0kvzmliSPfIVnfPbE,397
595
597
  reconcile/typed_queries/aws_vpc_requests.py,sha256=3LmBX9usfK8Uqr-pAux2oap01sXiMdGC_ihln6w4oV8,358
596
598
  reconcile/typed_queries/aws_vpcs.py,sha256=Fd0QCwXOH46UHw3-Xo_1ghtGYgUVJDpKf5Q3r1GpJGI,339
597
599
  reconcile/typed_queries/cloudflare.py,sha256=jOsqgCzMrjomPaIWc1isTcQAGONmMIJDTBcpmCheonA,308
@@ -618,7 +620,7 @@ reconcile/typed_queries/pagerduty_instances.py,sha256=zxCNxMak4iikryePaRi71lTADV
618
620
  reconcile/typed_queries/quay.py,sha256=OvkSDDbS3o4a4W5MqVxTAVmo47p5XegeoEVNiuqsevg,242
619
621
  reconcile/typed_queries/repos.py,sha256=8A93dKDt6igT4ClqMjt7YUTsoP4qh1Wnm0W3xsMgj48,824
620
622
  reconcile/typed_queries/reserved_networks.py,sha256=-f_CIrTn8u-dotj5VKFlAcD7TX1CSSuR7Ko2zC8OKEM,358
621
- reconcile/typed_queries/saas_files.py,sha256=IgXwDR3gfArCdmpPEEBXYDO7x-M_pwcEuKK-VbL2BEM,13931
623
+ reconcile/typed_queries/saas_files.py,sha256=lPJNh5F2ThJUjW2zvsCKPLm2DVNBnbHFbzWByqTg2uM,14012
622
624
  reconcile/typed_queries/slack.py,sha256=r30lspctHloyygPn8_DVybxPwUWwiBpvBRRXiTVcQYk,251
623
625
  reconcile/typed_queries/slo_documents.py,sha256=l7H6Uq85EcvvWUgmi5c1YHeJGk60KN-TBmi8d0w-XyU,375
624
626
  reconcile/typed_queries/smtp.py,sha256=aSLglYa5bHKmlGwKkxq2RZqyMWuAf0a4S_mOuhDa084,542
@@ -803,7 +805,7 @@ reconcile/utils/runtime/sharding.py,sha256=r0ieUtNed7NvknSw6qQrCkKpVXE1shuHGnfFc
803
805
  reconcile/utils/saasherder/__init__.py,sha256=J3MBZBFa5YmhqYm08QsjBXz8mFcVOCiOCkyIcw41t7E,343
804
806
  reconcile/utils/saasherder/interfaces.py,sha256=C2wrw34OXypshVocAsPrVZsSHptgw4g9u7Haa2wulZQ,9087
805
807
  reconcile/utils/saasherder/models.py,sha256=z8ln03zi2a8cu716NcNUDHp8Dv1VcVbhqdWVxCl7x9A,10148
806
- reconcile/utils/saasherder/saasherder.py,sha256=sC48LMtbKW2Mhyql2VwTMEYHugCXI9imdz8yeYlq0dk,84729
808
+ reconcile/utils/saasherder/saasherder.py,sha256=8yKSNuwLVJaJnOxGOHjhFaRqEmEbJxKqBj1-phI618o,84863
807
809
  reconcile/utils/terraform/__init__.py,sha256=zNbiyTWo35AT1sFTElL2j_AA0jJ_yWE_bfFn-nD2xik,250
808
810
  reconcile/utils/terraform/config.py,sha256=5UVrd563TMcvi4ooa5JvWVDW1I3bIWg484u79evfV_8,164
809
811
  reconcile/utils/terraform/config_client.py,sha256=gRL1rQ0AqvShei_rcGqC3HDYGskOFKE1nPrJyJE9yno,4676
@@ -823,7 +825,7 @@ tools/app_interface_metrics_exporter.py,sha256=zkwkxdAUAxjdc-pzx2_oJXG25fo0Fnyd5
823
825
  tools/app_interface_reporter.py,sha256=1ZP58LYV6ww3XOLVxgy8NKasMb1jQmp4BNqzTEB0VBE,17723
824
826
  tools/glitchtip_access_reporter.py,sha256=oPBnk_YoDuljU3v0FaChzOwwnk4vap1xEE67QEjzdqs,2948
825
827
  tools/glitchtip_access_revalidation.py,sha256=8kbBJk04mkq28kWoRDDkfCGIF3GRg3pJrFAh1sW0dbk,2821
826
- tools/qontract_cli.py,sha256=w_z2WAfPxXRXm8jbrg-Vc95sIYbPxVu3lCR14lEK3J4,125855
828
+ tools/qontract_cli.py,sha256=UC03zpZPnKu8M2CUmdaghhpN9ji4UYLQtr25hLnHAvg,126922
827
829
  tools/sd_app_sre_alert_report.py,sha256=e9vAdyenUz2f5c8-z-5WY0wv-SJ9aePKDH2r4IwB6pc,5063
828
830
  tools/template_validation.py,sha256=qpKYaTgk0GOPGa2Ct5_5sKdwIHtCAKIBGzsMPuJU5fw,3371
829
831
  tools/cli_commands/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -854,8 +856,8 @@ tools/test/test_qontract_cli.py,sha256=_D61RFGAN5x44CY1tYbouhlGXXABwYfxKSWSQx3Jr
854
856
  tools/test/test_saas_promotion_state.py,sha256=dy4kkSSAQ7bC0Xp2CociETGN-2aABEfL6FU5D9Jl00Y,6056
855
857
  tools/test/test_sd_app_sre_alert_report.py,sha256=v363r9zM7__0kR5K6mvJoGFcM9BvE33fWAayrqkpojA,2116
856
858
  tools/test/test_sre_checkpoints.py,sha256=SKqPPTl9ua0RFdSSofnoQX-JZE6dFLO3LRhfQzqtfh8,2607
857
- qontract_reconcile-0.10.1rc997.dist-info/METADATA,sha256=zxGaYZt6G_4RJZBpfsYs23oXou1bP0MNIEkxLY83WxA,2262
858
- qontract_reconcile-0.10.1rc997.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
859
- qontract_reconcile-0.10.1rc997.dist-info/entry_points.txt,sha256=GKQqCl2j2X1BJQ69een6rHcR26PmnxnONLNOQB-nRjY,491
860
- qontract_reconcile-0.10.1rc997.dist-info/top_level.txt,sha256=l5ISPoXzt0SdR4jVdkfa7RPSKNc8zAHYWAnR-Dw8Ey8,24
861
- qontract_reconcile-0.10.1rc997.dist-info/RECORD,,
859
+ qontract_reconcile-0.10.1rc999.dist-info/METADATA,sha256=enfD2JTSaUoouoeieJwg_fjf-OzHHSLEBR7icP_Nk1Y,2262
860
+ qontract_reconcile-0.10.1rc999.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
861
+ qontract_reconcile-0.10.1rc999.dist-info/entry_points.txt,sha256=GKQqCl2j2X1BJQ69een6rHcR26PmnxnONLNOQB-nRjY,491
862
+ qontract_reconcile-0.10.1rc999.dist-info/top_level.txt,sha256=l5ISPoXzt0SdR4jVdkfa7RPSKNc8zAHYWAnR-Dw8Ey8,24
863
+ qontract_reconcile-0.10.1rc999.dist-info/RECORD,,
@@ -0,0 +1,112 @@
1
+ """
2
+ Generated by qenerate plugin=pydantic_v1. DO NOT MODIFY MANUALLY!
3
+ """
4
+ from collections.abc import Callable # noqa: F401 # pylint: disable=W0611
5
+ from datetime import datetime # noqa: F401 # pylint: disable=W0611
6
+ from enum import Enum # noqa: F401 # pylint: disable=W0611
7
+ from typing import ( # noqa: F401 # pylint: disable=W0611
8
+ Any,
9
+ Optional,
10
+ Union,
11
+ )
12
+
13
+ from pydantic import ( # noqa: F401 # pylint: disable=W0611
14
+ BaseModel,
15
+ Extra,
16
+ Field,
17
+ Json,
18
+ )
19
+
20
+
21
+ DEFINITION = """
22
+ query AppQuayReposEscalationPolicies {
23
+ apps: apps_v1 {
24
+ name
25
+ escalationPolicy {
26
+ channels {
27
+ email
28
+ slackUserGroup {
29
+ handle
30
+ }
31
+ }
32
+ }
33
+ quayRepos {
34
+ org {
35
+ name
36
+ }
37
+ items {
38
+ name
39
+ mirror {
40
+ path
41
+ }
42
+ }
43
+ }
44
+ }
45
+ }
46
+ """
47
+
48
+
49
+ class ConfiguredBaseModel(BaseModel):
50
+ class Config:
51
+ smart_union=True
52
+ extra=Extra.forbid
53
+
54
+
55
+ class PermissionSlackUsergroupV1(ConfiguredBaseModel):
56
+ handle: str = Field(..., alias="handle")
57
+
58
+
59
+ class AppEscalationPolicyChannelsV1(ConfiguredBaseModel):
60
+ email: list[str] = Field(..., alias="email")
61
+ slack_user_group: list[PermissionSlackUsergroupV1] = Field(..., alias="slackUserGroup")
62
+
63
+
64
+ class AppEscalationPolicyV1(ConfiguredBaseModel):
65
+ channels: AppEscalationPolicyChannelsV1 = Field(..., alias="channels")
66
+
67
+
68
+ class QuayOrgV1(ConfiguredBaseModel):
69
+ name: str = Field(..., alias="name")
70
+
71
+
72
+ class ContainerImageMirrorV1(ConfiguredBaseModel):
73
+ path: str = Field(..., alias="path")
74
+
75
+
76
+ class AppQuayReposItemsV1(ConfiguredBaseModel):
77
+ name: str = Field(..., alias="name")
78
+ mirror: Optional[ContainerImageMirrorV1] = Field(..., alias="mirror")
79
+
80
+
81
+ class AppQuayReposV1(ConfiguredBaseModel):
82
+ org: QuayOrgV1 = Field(..., alias="org")
83
+ items: list[AppQuayReposItemsV1] = Field(..., alias="items")
84
+
85
+
86
+ class AppV1(ConfiguredBaseModel):
87
+ name: str = Field(..., alias="name")
88
+ escalation_policy: AppEscalationPolicyV1 = Field(..., alias="escalationPolicy")
89
+ quay_repos: Optional[list[AppQuayReposV1]] = Field(..., alias="quayRepos")
90
+
91
+
92
+ class AppQuayReposEscalationPoliciesQueryData(ConfiguredBaseModel):
93
+ apps: Optional[list[AppV1]] = Field(..., alias="apps")
94
+
95
+
96
+ def query(query_func: Callable, **kwargs: Any) -> AppQuayReposEscalationPoliciesQueryData:
97
+ """
98
+ This is a convenience function which queries and parses the data into
99
+ concrete types. It should be compatible with most GQL clients.
100
+ You do not have to use it to consume the generated data classes.
101
+ Alternatively, you can also mime and alternate the behavior
102
+ of this function in the caller.
103
+
104
+ Parameters:
105
+ query_func (Callable): Function which queries your GQL Server
106
+ kwargs: optional arguments that will be passed to the query function
107
+
108
+ Returns:
109
+ AppQuayReposEscalationPoliciesQueryData: queried data parsed into generated classes
110
+ """
111
+ raw_data: dict[Any, Any] = query_func(DEFINITION, **kwargs)
112
+ return AppQuayReposEscalationPoliciesQueryData(**raw_data)
@@ -233,6 +233,7 @@ query SaasFiles {
233
233
  }
234
234
  }
235
235
  validateTargetsInApp
236
+ validatePlannedData
236
237
  resourceTemplates {
237
238
  name
238
239
  url
@@ -560,6 +561,7 @@ class SaasFileV2(ConfiguredBaseModel):
560
561
  parameters: Optional[Json] = Field(..., alias="parameters")
561
562
  secret_parameters: Optional[list[SaasSecretParametersV1]] = Field(..., alias="secretParameters")
562
563
  validate_targets_in_app: Optional[bool] = Field(..., alias="validateTargetsInApp")
564
+ validate_planned_data: Optional[bool] = Field(..., alias="validatePlannedData")
563
565
  resource_templates: list[SaasResourceTemplateV2] = Field(..., alias="resourceTemplates")
564
566
  self_service_roles: Optional[list[SaasFileV2_RoleV1]] = Field(..., alias="selfServiceRoles")
565
567
 
@@ -238,7 +238,8 @@ def run(
238
238
 
239
239
  # validate that the deployment will succeed
240
240
  # to the best of our ability to predict
241
- ob.validate_planned_data(ri, oc_map)
241
+ if saasherder.validate_planned_data:
242
+ ob.validate_planned_data(ri, oc_map)
242
243
 
243
244
  # if saas_file_name is defined, the integration
244
245
  # is being called from multiple running instances
@@ -0,0 +1,14 @@
1
+ from reconcile.gql_definitions.common.app_quay_repos_escalation_policies import (
2
+ AppV1,
3
+ query,
4
+ )
5
+ from reconcile.utils import gql
6
+ from reconcile.utils.gql import GqlApi
7
+
8
+
9
+ def get_apps_quay_repos_escalation_policies(
10
+ gql_api: GqlApi | None = None,
11
+ ) -> list[AppV1]:
12
+ api = gql_api if gql_api else gql.get_api()
13
+ data = query(query_func=api.query)
14
+ return list(data.apps or [])
@@ -126,6 +126,7 @@ class SaasFile(ConfiguredBaseModel):
126
126
  ..., alias="secretParameters"
127
127
  )
128
128
  validate_targets_in_app: bool | None = Field(..., alias="validateTargetsInApp")
129
+ validate_planned_data: bool | None = Field(..., alias="validatePlannedData")
129
130
  managed_resource_names: list[ManagedResourceNamesV1] | None = Field(
130
131
  ..., alias="managedResourceNames"
131
132
  )
@@ -158,6 +158,9 @@ class SaasHerder: # pylint: disable=too-many-public-methods
158
158
  self.compare = self._get_saas_file_feature_enabled("compare", default=True)
159
159
  self.publish_job_logs = self._get_saas_file_feature_enabled("publish_job_logs")
160
160
  self.cluster_admin = self._get_saas_file_feature_enabled("cluster_admin")
161
+ self.validate_planned_data = self._get_saas_file_feature_enabled(
162
+ "validate_planned_data", default=True
163
+ )
161
164
 
162
165
  def __enter__(self) -> "SaasHerder":
163
166
  return self
tools/qontract_cli.py CHANGED
@@ -80,6 +80,9 @@ from reconcile.typed_queries.alerting_services_settings import get_alerting_serv
80
80
  from reconcile.typed_queries.app_interface_vault_settings import (
81
81
  get_app_interface_vault_settings,
82
82
  )
83
+ from reconcile.typed_queries.app_quay_repos_escalation_policies import (
84
+ get_apps_quay_repos_escalation_policies,
85
+ )
83
86
  from reconcile.typed_queries.clusters import get_clusters
84
87
  from reconcile.typed_queries.external_resources import (
85
88
  get_modules,
@@ -2843,6 +2846,33 @@ You can view the source of this Markdown to extract the JSON data.
2843
2846
  print_output(ctx.obj["options"], results, columns)
2844
2847
 
2845
2848
 
2849
+ @get.command
2850
+ @click.pass_context
2851
+ def container_image_details(ctx):
2852
+ apps = get_apps_quay_repos_escalation_policies()
2853
+ data: list[dict[str, str]] = []
2854
+ for app in apps:
2855
+ app_name = app.name
2856
+ ep_channels = app.escalation_policy.channels
2857
+ email = ep_channels.email
2858
+ slack = ep_channels.slack_user_group[0].handle
2859
+ for org_items in app.quay_repos or []:
2860
+ org_name = org_items.org.name
2861
+ for repo in org_items.items or []:
2862
+ if repo.mirror:
2863
+ continue
2864
+ repository = f"quay.io/{org_name}/{repo.name}"
2865
+ item = {
2866
+ "app": app_name,
2867
+ "repository": repository,
2868
+ "email": email,
2869
+ "slack": slack,
2870
+ }
2871
+ data.append(item)
2872
+ columns = ["app", "repository", "email", "slack"]
2873
+ print_output(ctx.obj["options"], data, columns)
2874
+
2875
+
2846
2876
  @root.group(name="set")
2847
2877
  @output
2848
2878
  @click.pass_context