qontract-reconcile 0.10.1rc934__py3-none-any.whl → 0.10.1rc936__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.1rc934
3
+ Version: 0.10.1rc936
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
@@ -332,7 +332,7 @@ reconcile/gql_definitions/membershipsources/__init__.py,sha256=47DEQpj8HBSa-_TIm
332
332
  reconcile/gql_definitions/membershipsources/roles.py,sha256=d3nv3GLsj_eKgwB1glsiK6smpC4i16WO3dU5rIdRg94,3678
333
333
  reconcile/gql_definitions/ocm_labels/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
334
334
  reconcile/gql_definitions/ocm_labels/clusters.py,sha256=K0DaTnOEdCZAziDbmq3Ktrxzzmzy6sdb3-9kIDk6yao,2932
335
- reconcile/gql_definitions/ocm_labels/organizations.py,sha256=mmYB5C5Fp_nPzwBDKdKG4qWiLre2VkZ26U_2O-jRKC4,2001
335
+ reconcile/gql_definitions/ocm_labels/organizations.py,sha256=ylNna62pG3XidrLQtMwu0LIOsKh6qyC2QImCbur2tV4,2252
336
336
  reconcile/gql_definitions/ocm_oidc_idp/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
337
337
  reconcile/gql_definitions/openshift_cluster_bots/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
338
338
  reconcile/gql_definitions/openshift_cluster_bots/clusters.py,sha256=QshhCQeFRu_o0DLpD-4ltT5X_xZHjsCLc5jB3an3UXs,3688
@@ -402,7 +402,7 @@ reconcile/ocm/types.py,sha256=vbHUUnD4CLR4TKFrVjWQtdCjPTI4A3h0Xodt3WlIsEo,2370
402
402
  reconcile/ocm_internal_notifications/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
403
403
  reconcile/ocm_internal_notifications/integration.py,sha256=FIFHGJSjk_22A32ajJ-W-zsPM0w01kUmGPA8MVYWMPE,4364
404
404
  reconcile/ocm_labels/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
405
- reconcile/ocm_labels/integration.py,sha256=Pvc6ZNCisJ4Q26V-lAaCJEGkulLHxiHjU4KECAtuci0,15186
405
+ reconcile/ocm_labels/integration.py,sha256=iM1yiapZIlRfCbzf3NJm5eghS_T4jMLZ0VKjTDGHwuc,15285
406
406
  reconcile/oum/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
407
407
  reconcile/oum/base.py,sha256=rkWsPO50fDiAuPjlEY3dvtMlSsSJmpxzXE8AFJB1zJA,13559
408
408
  reconcile/oum/labelset.py,sha256=f5kDndbaIT4iNYxTRPSELTUgj_aMlzEJDPzooAkG2mE,2154
@@ -466,7 +466,7 @@ reconcile/templating/validator.py,sha256=5f9f35PCHOOdjb7KZquL2YdabyuAUokPDa4xutS
466
466
  reconcile/templating/lib/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
467
467
  reconcile/templating/lib/merge_request_manager.py,sha256=P4IbblzXbubjlaxAYoahHFADUNIXLepfqwzdnHPs8OY,5608
468
468
  reconcile/templating/lib/model.py,sha256=Y1PeEP-koHKiH46JSwv4-PGRGQtcxZa9VmjTiuI6Lxs,889
469
- reconcile/templating/lib/rendering.py,sha256=6kt8NCCwB4vLKYal7KtRmBDguIC1p_PIQCRr-vL7p5w,5504
469
+ reconcile/templating/lib/rendering.py,sha256=pbZv8uYlNtgzTjYMl5qSIW94vDS4CfE47aSjX4HpL-k,6210
470
470
  reconcile/terraform_init/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
471
471
  reconcile/terraform_init/integration.py,sha256=glQ9uy8Kj2aTQXCAupwSFeih7reX_xMX_UuWW_ywBMU,6100
472
472
  reconcile/terraform_init/merge_request.py,sha256=3CYtgSd7Q9zjKg4wsDz437EPCRfGeZZ8fZ0Y-ChKXJY,1475
@@ -842,8 +842,8 @@ tools/test/test_qontract_cli.py,sha256=_D61RFGAN5x44CY1tYbouhlGXXABwYfxKSWSQx3Jr
842
842
  tools/test/test_saas_promotion_state.py,sha256=dy4kkSSAQ7bC0Xp2CociETGN-2aABEfL6FU5D9Jl00Y,6056
843
843
  tools/test/test_sd_app_sre_alert_report.py,sha256=v363r9zM7__0kR5K6mvJoGFcM9BvE33fWAayrqkpojA,2116
844
844
  tools/test/test_sre_checkpoints.py,sha256=SKqPPTl9ua0RFdSSofnoQX-JZE6dFLO3LRhfQzqtfh8,2607
845
- qontract_reconcile-0.10.1rc934.dist-info/METADATA,sha256=micYrUXFTKVnAM62FPDfNksiAyTEuVfwUTxRSWnAhKk,2262
846
- qontract_reconcile-0.10.1rc934.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
847
- qontract_reconcile-0.10.1rc934.dist-info/entry_points.txt,sha256=GKQqCl2j2X1BJQ69een6rHcR26PmnxnONLNOQB-nRjY,491
848
- qontract_reconcile-0.10.1rc934.dist-info/top_level.txt,sha256=l5ISPoXzt0SdR4jVdkfa7RPSKNc8zAHYWAnR-Dw8Ey8,24
849
- qontract_reconcile-0.10.1rc934.dist-info/RECORD,,
845
+ qontract_reconcile-0.10.1rc936.dist-info/METADATA,sha256=dTP9gHoWKPQXN31AI7YxwkBBy5LrGOf-GDfviQuVNeY,2262
846
+ qontract_reconcile-0.10.1rc936.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
847
+ qontract_reconcile-0.10.1rc936.dist-info/entry_points.txt,sha256=GKQqCl2j2X1BJQ69een6rHcR26PmnxnONLNOQB-nRjY,491
848
+ qontract_reconcile-0.10.1rc936.dist-info/top_level.txt,sha256=l5ISPoXzt0SdR4jVdkfa7RPSKNc8zAHYWAnR-Dw8Ey8,24
849
+ qontract_reconcile-0.10.1rc936.dist-info/RECORD,,
@@ -26,6 +26,9 @@ query OcmOrganizations {
26
26
  environment {
27
27
  name
28
28
  }
29
+ disable {
30
+ integrations
31
+ }
29
32
  }
30
33
  }
31
34
  """
@@ -41,10 +44,15 @@ class OpenShiftClusterManagerEnvironmentV1(ConfiguredBaseModel):
41
44
  name: str = Field(..., alias="name")
42
45
 
43
46
 
47
+ class DisableClusterAutomationsV1(ConfiguredBaseModel):
48
+ integrations: Optional[list[str]] = Field(..., alias="integrations")
49
+
50
+
44
51
  class OpenShiftClusterManagerV1(ConfiguredBaseModel):
45
52
  org_id: str = Field(..., alias="orgId")
46
53
  name: str = Field(..., alias="name")
47
54
  environment: OpenShiftClusterManagerEnvironmentV1 = Field(..., alias="environment")
55
+ disable: Optional[DisableClusterAutomationsV1] = Field(..., alias="disable")
48
56
 
49
57
 
50
58
  class OcmOrganizationsQueryData(ConfiguredBaseModel):
@@ -91,7 +91,11 @@ class OcmLabelsIntegration(QontractReconcileIntegration[OcmLabelsIntegrationPara
91
91
  def get_organizations(
92
92
  self, query_func: Callable
93
93
  ) -> list[OpenShiftClusterManagerV1]:
94
- return organization_query(query_func).organizations or []
94
+ return [
95
+ o
96
+ for o in organization_query(query_func).organizations or []
97
+ if integration_is_enabled(self.name, o)
98
+ ]
95
99
 
96
100
  def get_environments(self, query_func: Callable) -> list[OCMEnvironment]:
97
101
  return ocm_environment_query(query_func).environments
@@ -123,11 +123,28 @@ class PatchRenderer(Renderer):
123
123
  )
124
124
 
125
125
  if isinstance(matched_value, list):
126
- if not self.template.patch.identifier:
127
- raise ValueError(
128
- f"Expected identifier in patch for list at {self.template}"
129
- )
130
- dta_identifier = data_to_add.get(self.template.patch.identifier)
126
+
127
+ def get_identifier(data: dict[str, Any]) -> Any:
128
+ assert self.template.patch is not None # mypy
129
+ if not self.template.patch.identifier:
130
+ raise ValueError(
131
+ f"Expected identifier in patch for list at {self.template}"
132
+ )
133
+ if self.template.patch.identifier.startswith(
134
+ "$"
135
+ ) and not self.template.patch.identifier.startswith("$ref"):
136
+ # jsonpath and list of strings support
137
+ if matches := [
138
+ match.value
139
+ for match in parse_jsonpath(
140
+ self.template.patch.identifier
141
+ ).find(data)
142
+ ]:
143
+ return matches[0]
144
+ return None
145
+ return data.get(self.template.patch.identifier)
146
+
147
+ dta_identifier = get_identifier(data_to_add)
131
148
  if not dta_identifier:
132
149
  raise ValueError(
133
150
  f"Expected identifier {self.template.patch.identifier} in data to add"
@@ -137,7 +154,7 @@ class PatchRenderer(Renderer):
137
154
  (
138
155
  index
139
156
  for index, data in enumerate(matched_value)
140
- if data.get(self.template.patch.identifier) == dta_identifier
157
+ if get_identifier(data) == dta_identifier
141
158
  ),
142
159
  None,
143
160
  )