qontract-reconcile 0.10.1rc899__py3-none-any.whl → 0.10.1rc901__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.1rc899
3
+ Version: 0.10.1rc901
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
@@ -666,7 +666,7 @@ reconcile/utils/helpers.py,sha256=k9svgFFZG7H5FvHYY0g5jJyvgvh2UDZxf0Ib221teag,11
666
666
  reconcile/utils/imap_client.py,sha256=PMsX8UjJ2F59fXbbqREjLVdapYWznYTB8svFmpt39qA,1949
667
667
  reconcile/utils/instrumented_wrappers.py,sha256=eVwMoa6FCrYxLv3RML3WpZF9qKVfCTjMxphgVXG03OM,1073
668
668
  reconcile/utils/jenkins_api.py,sha256=RaKuZmO7_lbI-hE6c_Pq2a6CQdmBVj7BcP2jR68cIbI,7081
669
- reconcile/utils/jira_client.py,sha256=lNqqjlqQQDjbZwaeSj47T6mGarX_SUdjE_7KKwcTPbQ,7644
669
+ reconcile/utils/jira_client.py,sha256=VdWJfI9VAK2ZtYHmvuqL635t0S5eYtmBY6zR8R-qr-s,7775
670
670
  reconcile/utils/jjb_client.py,sha256=crbNkZocYTPBTEindscfLjaI7pi-91Tn7HVhkE6tF9E,14424
671
671
  reconcile/utils/jsonpath.py,sha256=wdxOMqR-GMpQf5vRPWRMqAF7bCiXDBkkcFfY2U4j_tk,5536
672
672
  reconcile/utils/jump_host.py,sha256=W3w0S-Qa-VLK5JGg-G4f2a4_5GA34KZVV3XNAaI53Y4,5148
@@ -765,9 +765,9 @@ reconcile/utils/mr/ocm_upgrade_scheduler_org_updates.py,sha256=ojnIjw-8vRnmCCxOG
765
765
  reconcile/utils/mr/user_maintenance.py,sha256=cHPBn8zrReWLHalyk-EFdkFJe9zjVjRoZhT4t2zZfGE,3956
766
766
  reconcile/utils/ocm/__init__.py,sha256=xv7CJp7K9LCQfa4gL_W0MMCOD1P4qOy8t5aZj1xXNUE,808
767
767
  reconcile/utils/ocm/addons.py,sha256=_LDdJ-gapM3s5exKlIUt-MlXZTAUoHezbYBU0QmvfWQ,7335
768
- reconcile/utils/ocm/base.py,sha256=WcRklW-zVOQ7JiYGbrqI9i3UYN7-A-V23bahAG1OVRo,13951
768
+ reconcile/utils/ocm/base.py,sha256=IF-TOj9YqDBfuXRMAxCZ8xFTNsgLQdsAxCtIk4UjH4E,14457
769
769
  reconcile/utils/ocm/cluster_groups.py,sha256=F8oqVqN_4QUnGL0K61zZhoYIzJeP57EcmZpwmoV0mr4,1751
770
- reconcile/utils/ocm/clusters.py,sha256=gfZgOVg5V74D2xpng_bWmZE5OVJYwJLBSTUZyiOjTV0,7616
770
+ reconcile/utils/ocm/clusters.py,sha256=Fn4swizm1qq-XiNlIZ9SvahkftWAyNT8hF4kqRBpK4g,8287
771
771
  reconcile/utils/ocm/identity_providers.py,sha256=dKed09N8iWmn39tI_MpwgVe47x23eLsknGbjMUxtwr4,2175
772
772
  reconcile/utils/ocm/label_sources.py,sha256=ES_5VP4X6gsRxMFZ95WgbwE_HqqIUo_JRjHjdGYw6Ss,1846
773
773
  reconcile/utils/ocm/labels.py,sha256=aCsL5QkRk32hZeJwsSJuCCT9sbojWMn8LL5Zo-aoFb4,5916
@@ -844,8 +844,8 @@ tools/test/test_qontract_cli.py,sha256=_D61RFGAN5x44CY1tYbouhlGXXABwYfxKSWSQx3Jr
844
844
  tools/test/test_saas_promotion_state.py,sha256=dy4kkSSAQ7bC0Xp2CociETGN-2aABEfL6FU5D9Jl00Y,6056
845
845
  tools/test/test_sd_app_sre_alert_report.py,sha256=v363r9zM7__0kR5K6mvJoGFcM9BvE33fWAayrqkpojA,2116
846
846
  tools/test/test_sre_checkpoints.py,sha256=SKqPPTl9ua0RFdSSofnoQX-JZE6dFLO3LRhfQzqtfh8,2607
847
- qontract_reconcile-0.10.1rc899.dist-info/METADATA,sha256=7CJ9adlmsE4h9lgftGf26kORoj0ADEH_t14mjUg9P6M,2273
848
- qontract_reconcile-0.10.1rc899.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
849
- qontract_reconcile-0.10.1rc899.dist-info/entry_points.txt,sha256=GKQqCl2j2X1BJQ69een6rHcR26PmnxnONLNOQB-nRjY,491
850
- qontract_reconcile-0.10.1rc899.dist-info/top_level.txt,sha256=l5ISPoXzt0SdR4jVdkfa7RPSKNc8zAHYWAnR-Dw8Ey8,24
851
- qontract_reconcile-0.10.1rc899.dist-info/RECORD,,
847
+ qontract_reconcile-0.10.1rc901.dist-info/METADATA,sha256=ajNH3FKyAgiAEU36s_fRqlubaWQuOpyApTeND5vKlYw,2273
848
+ qontract_reconcile-0.10.1rc901.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
849
+ qontract_reconcile-0.10.1rc901.dist-info/entry_points.txt,sha256=GKQqCl2j2X1BJQ69een6rHcR26PmnxnONLNOQB-nRjY,491
850
+ qontract_reconcile-0.10.1rc901.dist-info/top_level.txt,sha256=l5ISPoXzt0SdR4jVdkfa7RPSKNc8zAHYWAnR-Dw8Ey8,24
851
+ qontract_reconcile-0.10.1rc901.dist-info/RECORD,,
@@ -105,7 +105,10 @@ class JiraClient:
105
105
  raise RuntimeError("JiraClient.server is not set.")
106
106
 
107
107
  self.jira = JIRA(
108
- self.server, token_auth=token_auth, timeout=(read_timeout, connect_timeout)
108
+ self.server,
109
+ token_auth=token_auth,
110
+ timeout=(read_timeout, connect_timeout),
111
+ logging=False,
109
112
  )
110
113
 
111
114
  @staticmethod
@@ -121,7 +124,10 @@ class JiraClient:
121
124
  read_timeout = jira_watcher_settings.read_timeout
122
125
  connect_timeout = jira_watcher_settings.connect_timeout
123
126
  jira_api = JIRA(
124
- server=server_url, token_auth=token, timeout=(read_timeout, connect_timeout)
127
+ server=server_url,
128
+ token_auth=token,
129
+ timeout=(read_timeout, connect_timeout),
130
+ logging=False,
125
131
  )
126
132
  return JiraClient(
127
133
  jira_api=jira_api,
@@ -228,6 +234,7 @@ class JiraClient:
228
234
  JiraClient.DEFAULT_READ_TIMEOUT,
229
235
  JiraClient.DEFAULT_CONNECT_TIMEOUT,
230
236
  ),
237
+ logging=False,
231
238
  )
232
239
  return [project.key for project in jira_api_anon.projects()]
233
240
 
@@ -210,6 +210,27 @@ PRODUCT_ID_OSD = "osd"
210
210
  PRODUCT_ID_ROSA = "rosa"
211
211
 
212
212
 
213
+ class ProvisionShard(BaseModel):
214
+ kind: str = "ProvisionShard"
215
+ id: str
216
+
217
+
218
+ class ClusterManagementReference(BaseModel):
219
+ cluster_id: str
220
+ href: str
221
+
222
+
223
+ class FleetManagerServiceCluster(BaseModel):
224
+ kind: str = "ServiceCluster"
225
+
226
+ """
227
+ Using OSDFleetManager API, which has different object ids.
228
+ https://api.openshift.com/?urls.primaryName=OSD%20Fleet%20Manager%20service
229
+ """
230
+ cluster_management_reference: ClusterManagementReference
231
+ provision_shard_reference: OCMModelLink
232
+
233
+
213
234
  class OCMCluster(BaseModel):
214
235
  kind: str = "Cluster"
215
236
  id: str
@@ -11,10 +11,12 @@ from reconcile.utils.ocm.base import (
11
11
  PRODUCT_ID_OSD,
12
12
  PRODUCT_ID_ROSA,
13
13
  ClusterDetails,
14
+ FleetManagerServiceCluster,
14
15
  OCMCluster,
15
16
  OCMClusterState,
16
17
  OCMOrganizationLabel,
17
18
  OCMSubscriptionLabel,
19
+ ProvisionShard,
18
20
  build_label_container,
19
21
  )
20
22
  from reconcile.utils.ocm.labels import (
@@ -146,6 +148,26 @@ def get_ocm_clusters(
146
148
  yield OCMCluster(**cluster_dict)
147
149
 
148
150
 
151
+ def get_provision_shard_for_cluster_id(
152
+ ocm_api: OCMBaseClient,
153
+ id: str,
154
+ ) -> ProvisionShard:
155
+ data = ocm_api.get(api_path=f"/api/clusters_mgmt/v1/clusters/{id}/provision_shard")
156
+ return ProvisionShard(**data)
157
+
158
+
159
+ def get_service_clusters(
160
+ ocm_api: OCMBaseClient,
161
+ ) -> Generator[FleetManagerServiceCluster, None, None]:
162
+ for cluster_dict in ocm_api.get_paginated(
163
+ api_path="/api/osd_fleet_mgmt/v1/service_clusters",
164
+ max_page_size=100,
165
+ ):
166
+ if not cluster_dict.get("provision_shard_reference"):
167
+ continue
168
+ yield FleetManagerServiceCluster(**cluster_dict)
169
+
170
+
149
171
  def get_cluster_details_for_subscriptions(
150
172
  ocm_api: OCMBaseClient,
151
173
  subscription_filter: Filter | None = None,