qontract-reconcile 0.10.1rc827__py3-none-any.whl → 0.10.1rc828__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.1rc827
3
+ Version: 0.10.1rc828
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
@@ -53,7 +53,7 @@ reconcile/mr_client_gateway.py,sha256=WhjMd-sIXDFCV8-rt8CEjurJ5OYB1pOD0K3o0tZRXQ
53
53
  reconcile/ocm_additional_routers.py,sha256=KfcFDVbNoc6n5dHWjYdAf1_DiVqVG6Tw23WLKoV8cdg,3306
54
54
  reconcile/ocm_addons.py,sha256=qqAyqRBRbdZQvAcjb-QlSVyRAyQBZk6iVlgnI4jyi7s,3353
55
55
  reconcile/ocm_addons_upgrade_tests_trigger.py,sha256=L1ktYynIR7pmHiYtdCTdLGJRKX72B54KUAuPLOccXzo,3995
56
- reconcile/ocm_aws_infrastructure_access.py,sha256=kDnJP6aOFO263LSbdCxJMmUwVsM3LgdzebtIUOoIhH8,7130
56
+ reconcile/ocm_aws_infrastructure_access.py,sha256=SghVWdmgliPVo_xHsp-e64_iC3mqDiia2ANSHb-g5G8,6891
57
57
  reconcile/ocm_clusters.py,sha256=ZUW4aqZuRDNzNS_Ojx-sjWIxemdgiJUIJn51YaQa_7k,16733
58
58
  reconcile/ocm_external_configuration_labels.py,sha256=imEpDv1RBpCSj8tHDv0R76hmNCFtcUzVNgS1yOVl8vs,3870
59
59
  reconcile/ocm_github_idp.py,sha256=glwXMsIBcl38-OmDDQCpe0YoLLXfoRgVQmqwXMEXjds,3946
@@ -812,8 +812,8 @@ tools/test/test_app_interface_metrics_exporter.py,sha256=SX7qL3D1SIRKFo95FoQztvf
812
812
  tools/test/test_qontract_cli.py,sha256=_D61RFGAN5x44CY1tYbouhlGXXABwYfxKSWSQx3Jrss,4941
813
813
  tools/test/test_sd_app_sre_alert_report.py,sha256=v363r9zM7__0kR5K6mvJoGFcM9BvE33fWAayrqkpojA,2116
814
814
  tools/test/test_sre_checkpoints.py,sha256=SKqPPTl9ua0RFdSSofnoQX-JZE6dFLO3LRhfQzqtfh8,2607
815
- qontract_reconcile-0.10.1rc827.dist-info/METADATA,sha256=u5Eopi8oHyBimPZUq-Bc7QvHZttOUWrLGXF2f7raVV4,2314
816
- qontract_reconcile-0.10.1rc827.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
817
- qontract_reconcile-0.10.1rc827.dist-info/entry_points.txt,sha256=GKQqCl2j2X1BJQ69een6rHcR26PmnxnONLNOQB-nRjY,491
818
- qontract_reconcile-0.10.1rc827.dist-info/top_level.txt,sha256=l5ISPoXzt0SdR4jVdkfa7RPSKNc8zAHYWAnR-Dw8Ey8,24
819
- qontract_reconcile-0.10.1rc827.dist-info/RECORD,,
815
+ qontract_reconcile-0.10.1rc828.dist-info/METADATA,sha256=zn9mUDpdoboyaXrhQNN2Qq2Msqp99DriqAcjRMCgJmM,2314
816
+ qontract_reconcile-0.10.1rc828.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
817
+ qontract_reconcile-0.10.1rc828.dist-info/entry_points.txt,sha256=GKQqCl2j2X1BJQ69een6rHcR26PmnxnONLNOQB-nRjY,491
818
+ qontract_reconcile-0.10.1rc828.dist-info/top_level.txt,sha256=l5ISPoXzt0SdR4jVdkfa7RPSKNc8zAHYWAnR-Dw8Ey8,24
819
+ qontract_reconcile-0.10.1rc828.dist-info/RECORD,,
@@ -52,17 +52,9 @@ def fetch_current_state(clusters):
52
52
  return ocm_map, current_state, current_failed, current_deleting
53
53
 
54
54
 
55
- def fetch_desired_state():
55
+ def fetch_desired_state(clusters):
56
56
  desired_state = []
57
57
 
58
- # get desired state defined in awsInfrastructureAccess
59
- # or awsInfrastructureManagementAccounts
60
- # sections of cluster files
61
- clusters = [
62
- c
63
- for c in queries.get_clusters(aws_infrastructure_access=True)
64
- if c.get("ocm") is not None and c["spec"]["product"] in SUPPORTED_OCM_PRODUCTS
65
- ]
66
58
  for cluster_info in clusters:
67
59
  cluster = cluster_info["name"]
68
60
  aws_infra_access_items = cluster_info.get("awsInfrastructureAccess") or []
@@ -181,12 +173,16 @@ def _cluster_is_compatible(cluster: Mapping[str, Any]) -> bool:
181
173
  )
182
174
 
183
175
 
184
- def run(dry_run):
185
- clusters = [
176
+ def get_clusters():
177
+ return [
186
178
  c
187
179
  for c in queries.get_clusters(aws_infrastructure_access=True)
188
180
  if integration_is_enabled(QONTRACT_INTEGRATION, c) and _cluster_is_compatible(c)
189
181
  ]
182
+
183
+
184
+ def run(dry_run):
185
+ clusters = get_clusters()
190
186
  if not clusters:
191
187
  logging.debug(
192
188
  "No OCM Aws infrastructure access definitions found in app-interface"
@@ -196,11 +192,11 @@ def run(dry_run):
196
192
  ocm_map, current_state, current_failed, current_deleting = fetch_current_state(
197
193
  clusters
198
194
  )
199
- desired_state = fetch_desired_state()
195
+ desired_state = fetch_desired_state(clusters)
200
196
  act(
201
197
  dry_run, ocm_map, current_state, current_failed, desired_state, current_deleting
202
198
  )
203
199
 
204
200
 
205
201
  def early_exit_desired_state(*args: Any, **kwargs: Any) -> dict[str, Any]:
206
- return {"state": fetch_desired_state()}
202
+ return {"state": fetch_desired_state(clusters=get_clusters())}