qontract-reconcile 0.10.1rc1116__py3-none-any.whl → 0.10.1rc1118__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.1rc1116
3
+ Version: 0.10.1rc1118
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
@@ -161,10 +161,10 @@ reconcile/aws_version_sync/merge_request_manager/merge_request_manager.py,sha256
161
161
  reconcile/change_owners/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
162
162
  reconcile/change_owners/approver.py,sha256=Z3_11vnK2WNOxjEEXVDh0224-_-qbt9d6mBeVE-7fsc,2259
163
163
  reconcile/change_owners/bundle.py,sha256=h30fU-JmLH5a-rCAovpzTeTkkkgZztsZ5A2raee0YuU,5355
164
- reconcile/change_owners/change_log_tracking.py,sha256=QuXVWIfLMasGDe_9f_IJnDSf-iHed10bv0S_x43YxXc,7771
164
+ reconcile/change_owners/change_log_tracking.py,sha256=qEGSH3C6FUxmz-rPNyQCqwM8kYK3tNtHVgQHzQjIWh0,7814
165
165
  reconcile/change_owners/change_owners.py,sha256=0HRJhDm0oW3uYJFgzynqA1gA0lbhalhSkmWOiQmr-NM,17062
166
166
  reconcile/change_owners/change_types.py,sha256=HEsoBduhcczAXZHwT26mr5sVPxtf8J6tsvjSDDI1ceI,32077
167
- reconcile/change_owners/changes.py,sha256=qdw4ZxOVbTzSATxmLUtJ9HA6BZXwxkHfQljrWv-Q8sU,18244
167
+ reconcile/change_owners/changes.py,sha256=YblT-JPFagctTphzd38SjVmj3k1YsgMzN48zGpnLYKM,18222
168
168
  reconcile/change_owners/decision.py,sha256=iUJcIc_N_RqXIAY8D10RZqPMC2OinsHTMcqI6f6uylE,7606
169
169
  reconcile/change_owners/diff.py,sha256=0vyu29xCL24ZhUa7hqBni0NaxoCYRXLwvA-h8V23YQ4,9009
170
170
  reconcile/change_owners/implicit_ownership.py,sha256=6BehZvx4IjrphmOt_LLLk9_02Fl5BY5jd00Wuz_PBZk,4234
@@ -196,9 +196,9 @@ reconcile/external_resources/aws.py,sha256=7W-6d-lXO6JGwaxtO1Uc3Lw0p8csJ1EVgz__O
196
196
  reconcile/external_resources/factories.py,sha256=nhdTqf1WEfRfgd5-70KAUJVz0ZvZ19C3Pz7wmotSdrs,4857
197
197
  reconcile/external_resources/integration.py,sha256=y1gJ16woMBC3J9qniMmS5y3lCkAs7V_ETZRUwjKqaO0,6628
198
198
  reconcile/external_resources/integration_secrets_sync.py,sha256=cMEZhgCvABAMf-DWF051L6CRnJQdfbsISA_b1xuS940,1670
199
- reconcile/external_resources/manager.py,sha256=AvBYpC4p2BaGrxYEV1ut3V2FtJfs1h2z0Vk8Px6dCaQ,15641
199
+ reconcile/external_resources/manager.py,sha256=cs6QEirz9EaLiuxybZ_1ugUn61vNWlKAC4NKouqpd5I,16148
200
200
  reconcile/external_resources/meta.py,sha256=noaytFzmShpzLA_ebGh7wuP45mOfHIOnnoUxivjDa1I,672
201
- reconcile/external_resources/metrics.py,sha256=Ihhe39BX0h2w7eLvvdijJuCXjj-f7w1E3MfDL0YiGNU,668
201
+ reconcile/external_resources/metrics.py,sha256=jsN3IF78Su23d3Qp4BTKXkgZPN6AKjdS8sZFEXmYCek,863
202
202
  reconcile/external_resources/model.py,sha256=UuQgrnv-SSkvSEQQGeCE2IZkhXjLTCVkP_mw8zBZsIQ,8349
203
203
  reconcile/external_resources/reconciler.py,sha256=3KFmkHsN7YAwJUSBpN1Xd_D2zM9Ea5_c2uMGWsfruZo,9707
204
204
  reconcile/external_resources/secrets_sync.py,sha256=6n0oDPLjd9Ql0lf6zsr1AZw8A6EEe3yCzl20XodtgkE,16229
@@ -261,7 +261,7 @@ reconcile/gql_definitions/common/clusters_with_peering.py,sha256=B1Hi3u6rZZsl4bD
261
261
  reconcile/gql_definitions/common/github_orgs.py,sha256=rZ0pDAA2_9hF9N-ykRZIxPtEmczTSjuA_k3nkp0k1W0,2039
262
262
  reconcile/gql_definitions/common/jira_settings.py,sha256=Fmjxhlhr69kc4jkG_0k17fuYlQVucbNex0jXYu83wbY,1990
263
263
  reconcile/gql_definitions/common/jiralert_settings.py,sha256=H96nMg_r2YcOvioj3aIkwqtFrALGSLt7uhbx9jGSUTo,1984
264
- reconcile/gql_definitions/common/namespaces.py,sha256=AmE6XSxGVKYUHjmWI8y2scHw1ya9EfTnEkvffzyRKDE,8922
264
+ reconcile/gql_definitions/common/namespaces.py,sha256=HnNPJbrzbEknpX3e6l4wCmH6PawtwwSUbQCnbcq7x2s,11019
265
265
  reconcile/gql_definitions/common/namespaces_minimal.py,sha256=XVt8LFe-bGYbjN3ysX3b9sFGmLX4snQ_A9ZouQGaaAI,3429
266
266
  reconcile/gql_definitions/common/ocm_env_telemeter.py,sha256=jW0Q9WazDQVOxh4u0LMFG69rupBioJ8HGGjvR9bVK9Y,2424
267
267
  reconcile/gql_definitions/common/ocm_environments.py,sha256=6-_4Bf6-wBWykNBxVAFYnDkgM8sSoATKdabakDR9ENs,2018
@@ -869,8 +869,8 @@ tools/test/test_qontract_cli.py,sha256=_D61RFGAN5x44CY1tYbouhlGXXABwYfxKSWSQx3Jr
869
869
  tools/test/test_saas_promotion_state.py,sha256=dy4kkSSAQ7bC0Xp2CociETGN-2aABEfL6FU5D9Jl00Y,6056
870
870
  tools/test/test_sd_app_sre_alert_report.py,sha256=v363r9zM7__0kR5K6mvJoGFcM9BvE33fWAayrqkpojA,2116
871
871
  tools/test/test_sre_checkpoints.py,sha256=SKqPPTl9ua0RFdSSofnoQX-JZE6dFLO3LRhfQzqtfh8,2607
872
- qontract_reconcile-0.10.1rc1116.dist-info/METADATA,sha256=FuJrNLTiKxo9O9hatAzIX5lB3r7V_KZNiDDpnB1OuCw,2213
873
- qontract_reconcile-0.10.1rc1116.dist-info/WHEEL,sha256=eOLhNAGa2EW3wWl_TU484h7q1UNgy0JXjjoqKoxAAQc,92
874
- qontract_reconcile-0.10.1rc1116.dist-info/entry_points.txt,sha256=GKQqCl2j2X1BJQ69een6rHcR26PmnxnONLNOQB-nRjY,491
875
- qontract_reconcile-0.10.1rc1116.dist-info/top_level.txt,sha256=l5ISPoXzt0SdR4jVdkfa7RPSKNc8zAHYWAnR-Dw8Ey8,24
876
- qontract_reconcile-0.10.1rc1116.dist-info/RECORD,,
872
+ qontract_reconcile-0.10.1rc1118.dist-info/METADATA,sha256=2jeVjBwwFsNDGFNPGxlQNAiSf5JMp9mD7IOhqYwQa8M,2213
873
+ qontract_reconcile-0.10.1rc1118.dist-info/WHEEL,sha256=eOLhNAGa2EW3wWl_TU484h7q1UNgy0JXjjoqKoxAAQc,92
874
+ qontract_reconcile-0.10.1rc1118.dist-info/entry_points.txt,sha256=GKQqCl2j2X1BJQ69een6rHcR26PmnxnONLNOQB-nRjY,491
875
+ qontract_reconcile-0.10.1rc1118.dist-info/top_level.txt,sha256=l5ISPoXzt0SdR4jVdkfa7RPSKNc8zAHYWAnR-Dw8Ey8,24
876
+ qontract_reconcile-0.10.1rc1118.dist-info/RECORD,,
@@ -18,8 +18,8 @@ from reconcile.change_owners.changes import (
18
18
  parse_bundle_changes,
19
19
  )
20
20
  from reconcile.typed_queries.apps import get_apps
21
- from reconcile.typed_queries.external_resources import get_namespaces
22
21
  from reconcile.typed_queries.jenkins import get_jenkins_configs
22
+ from reconcile.typed_queries.namespaces import get_namespaces
23
23
  from reconcile.utils import gql
24
24
  from reconcile.utils.defer import defer
25
25
  from reconcile.utils.gitlab_api import MRState
@@ -135,7 +135,9 @@ class ChangeLogIntegration(QontractReconcileIntegration[ChangeLogIntegrationPara
135
135
  diff = QontractServerDiff(**obj)
136
136
  changes = aggregate_resource_changes(
137
137
  bundle_changes=aggregate_file_moves(parse_bundle_changes(diff)),
138
- content_store={c.path: c.dict() for c in namespaces + jenkins_configs},
138
+ content_store={
139
+ c.path: c.dict(by_alias=True) for c in namespaces + jenkins_configs
140
+ },
139
141
  supported_schemas={
140
142
  "/openshift/namespace-1.yml",
141
143
  "/dependencies/jenkins-config-1.yml",
@@ -10,7 +10,6 @@ from dataclasses import (
10
10
  from typing import Any
11
11
 
12
12
  import anymarkup
13
- import jsonpath_ng
14
13
 
15
14
  from reconcile.change_owners.bundle import (
16
15
  DATAFILE_PATH_FIELD_NAME,
@@ -473,7 +472,7 @@ def aggregate_resource_changes(
473
472
  new_content_sha="",
474
473
  diffs=[
475
474
  Diff(
476
- path=jsonpath_ng.parse(file_ref.json_path),
475
+ path=parse_jsonpath(file_ref.json_path),
477
476
  diff_type=DiffType.CHANGED,
478
477
  old=file_content,
479
478
  new=file_content,
@@ -16,6 +16,7 @@ from reconcile.external_resources.factories import (
16
16
  from reconcile.external_resources.metrics import (
17
17
  ExternalResourcesReconcileErrorsCounter,
18
18
  ExternalResourcesReconcileTimeGauge,
19
+ ExternalResourcesResourceStatus,
19
20
  )
20
21
  from reconcile.external_resources.model import (
21
22
  Action,
@@ -212,7 +213,7 @@ class ExternalResourcesManager:
212
213
  return to_reconcile
213
214
 
214
215
  def _update_in_progress_state(
215
- self, r: Reconciliation, state: ExternalResourceState
216
+ self, r: Reconciliation, state: ExternalResourceState, job_name: str
216
217
  ) -> bool:
217
218
  """Gets the resource reconciliation state from the Job and updates the
218
219
  Resource state accordingly. It also returns if the target outputs secret needs
@@ -238,7 +239,6 @@ class ExternalResourcesManager:
238
239
 
239
240
  # Need to check the reconciliation set in the state, not the desired one
240
241
  # as the reconciliation object might be from a previous desired state
241
- job_name = ReconciliationK8sJob(reconciliation=r).name()
242
242
  error = False
243
243
  match self.reconciler.get_resource_reconcile_status(state.reconciliation):
244
244
  case ReconcileStatus.SUCCESS:
@@ -291,7 +291,6 @@ class ExternalResourcesManager:
291
291
  job_name=job_name,
292
292
  )
293
293
  )
294
-
295
294
  return need_secret_sync
296
295
 
297
296
  def _update_state(self, r: Reconciliation, state: ExternalResourceState) -> None:
@@ -353,7 +352,8 @@ class ExternalResourcesManager:
353
352
  to_sync_keys: set[ExternalResourceKey] = set()
354
353
  for r in desired_r.union(deleted_r):
355
354
  state = self.state_mgr.get_external_resource_state(r.key)
356
- need_sync = self._update_in_progress_state(r, state)
355
+ job_name = ReconciliationK8sJob(reconciliation=r).name()
356
+ need_sync = self._update_in_progress_state(r, state, job_name)
357
357
  if need_sync:
358
358
  to_sync_keys.add(r.key)
359
359
 
@@ -361,6 +361,18 @@ class ExternalResourcesManager:
361
361
  self.reconciler.reconcile_resource(reconciliation=r)
362
362
  self._update_state(r, state)
363
363
 
364
+ metrics.set_gauge(
365
+ ExternalResourcesResourceStatus(
366
+ provision_provider=r.key.provision_provider,
367
+ provisioner_name=r.key.provisioner_name,
368
+ provider=r.key.provider,
369
+ identifier=r.key.identifier,
370
+ job_name=job_name,
371
+ status=state.resource_status,
372
+ ),
373
+ 1,
374
+ )
375
+
364
376
  pending_sync_keys = self.state_mgr.get_keys_by_status(
365
377
  ResourceStatus.PENDING_SECRET_SYNC
366
378
  )
@@ -24,3 +24,11 @@ class ExternalResourcesReconcileTimeGauge(ExternalResourcesBaseMetric, GaugeMetr
24
24
  @classmethod
25
25
  def name(cls) -> str:
26
26
  return "external_resources_reconcile_time"
27
+
28
+
29
+ class ExternalResourcesResourceStatus(ExternalResourcesBaseMetric, GaugeMetric):
30
+ status: str
31
+
32
+ @classmethod
33
+ def name(cls) -> str:
34
+ return "external_resources_resource_status"
@@ -48,6 +48,7 @@ fragment VaultSecret on VaultSecret_v1 {
48
48
 
49
49
  query Namespaces {
50
50
  namespaces: namespaces_v1 {
51
+ path
51
52
  name
52
53
  delete
53
54
  labels
@@ -60,6 +61,29 @@ query Namespaces {
60
61
  email
61
62
  }
62
63
  }
64
+ openshiftResources {
65
+ provider
66
+ ... on NamespaceOpenshiftResourceResource_v1 {
67
+ path {
68
+ content
69
+ }
70
+ }
71
+ ... on NamespaceOpenshiftResourceResourceTemplate_v1 {
72
+ path {
73
+ content
74
+ }
75
+ }
76
+ ... on NamespaceOpenshiftResourceRoute_v1 {
77
+ path {
78
+ content
79
+ }
80
+ }
81
+ ... on NamespaceOpenshiftResourcePrometheusRule_v1 {
82
+ path {
83
+ content
84
+ }
85
+ }
86
+ }
63
87
  managedExternalResources
64
88
  externalResources {
65
89
  provider
@@ -172,6 +196,42 @@ class AppV1(ConfiguredBaseModel):
172
196
  service_owners: Optional[list[OwnerV1]] = Field(..., alias="serviceOwners")
173
197
 
174
198
 
199
+ class NamespaceOpenshiftResourceV1(ConfiguredBaseModel):
200
+ provider: str = Field(..., alias="provider")
201
+
202
+
203
+ class ResourceV1(ConfiguredBaseModel):
204
+ content: str = Field(..., alias="content")
205
+
206
+
207
+ class NamespaceOpenshiftResourceResourceV1(NamespaceOpenshiftResourceV1):
208
+ path: Optional[ResourceV1] = Field(..., alias="path")
209
+
210
+
211
+ class NamespaceOpenshiftResourceResourceTemplateV1_ResourceV1(ConfiguredBaseModel):
212
+ content: str = Field(..., alias="content")
213
+
214
+
215
+ class NamespaceOpenshiftResourceResourceTemplateV1(NamespaceOpenshiftResourceV1):
216
+ path: Optional[NamespaceOpenshiftResourceResourceTemplateV1_ResourceV1] = Field(..., alias="path")
217
+
218
+
219
+ class NamespaceOpenshiftResourceRouteV1_ResourceV1(ConfiguredBaseModel):
220
+ content: str = Field(..., alias="content")
221
+
222
+
223
+ class NamespaceOpenshiftResourceRouteV1(NamespaceOpenshiftResourceV1):
224
+ path: Optional[NamespaceOpenshiftResourceRouteV1_ResourceV1] = Field(..., alias="path")
225
+
226
+
227
+ class NamespaceOpenshiftResourcePrometheusRuleV1_ResourceV1(ConfiguredBaseModel):
228
+ content: str = Field(..., alias="content")
229
+
230
+
231
+ class NamespaceOpenshiftResourcePrometheusRuleV1(NamespaceOpenshiftResourceV1):
232
+ path: Optional[NamespaceOpenshiftResourcePrometheusRuleV1_ResourceV1] = Field(..., alias="path")
233
+
234
+
175
235
  class ExternalResourcesProvisionerV1(ConfiguredBaseModel):
176
236
  name: str = Field(..., alias="name")
177
237
 
@@ -261,12 +321,14 @@ class ResourceQuotaV1(ConfiguredBaseModel):
261
321
 
262
322
 
263
323
  class NamespaceV1(ConfiguredBaseModel):
324
+ path: str = Field(..., alias="path")
264
325
  name: str = Field(..., alias="name")
265
326
  delete: Optional[bool] = Field(..., alias="delete")
266
327
  labels: Optional[Json] = Field(..., alias="labels")
267
328
  cluster_admin: Optional[bool] = Field(..., alias="clusterAdmin")
268
329
  managed_roles: Optional[bool] = Field(..., alias="managedRoles")
269
330
  app: AppV1 = Field(..., alias="app")
331
+ openshift_resources: Optional[list[Union[NamespaceOpenshiftResourceResourceV1, NamespaceOpenshiftResourceResourceTemplateV1, NamespaceOpenshiftResourceRouteV1, NamespaceOpenshiftResourcePrometheusRuleV1, NamespaceOpenshiftResourceV1]]] = Field(..., alias="openshiftResources")
270
332
  managed_external_resources: Optional[bool] = Field(..., alias="managedExternalResources")
271
333
  external_resources: Optional[list[Union[NamespaceTerraformProviderResourceAWSV1, NamespaceExternalResourceV1]]] = Field(..., alias="externalResources")
272
334
  cluster: ClusterV1 = Field(..., alias="cluster")