qontract-reconcile 0.10.1rc1131__py3-none-any.whl → 0.10.1rc1133__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.1rc1131
3
+ Version: 0.10.1rc1133
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
@@ -17,7 +17,7 @@ reconcile/dashdotdb_base.py,sha256=l34QDu1G96_Ctnh7ZXdxXgSeCE93GQMdLAkWxmN6vDA,4
17
17
  reconcile/dashdotdb_cso.py,sha256=IkI_KSZuH_kPn0cIQKXitJXiPPFSyHykrOuFy9h9ZpU,3643
18
18
  reconcile/dashdotdb_dora.py,sha256=YmfxD02tKUAQQzku2aj2DXv1oKkAr4V_2lrPVtTFGyI,17674
19
19
  reconcile/dashdotdb_dvo.py,sha256=lCkZ0iby6HrNQb-3kYb6xrt8wCjVUZYxKzz9SiStfHU,8946
20
- reconcile/dashdotdb_slo.py,sha256=S7j7xFeGaJkE82biWEdPu6ORCJEsJYNTDqcTzSl8AQY,6679
20
+ reconcile/dashdotdb_slo.py,sha256=s-AMW927seimHou19h4fHnvjUJwkXcJRBEHi6HjOMI8,7106
21
21
  reconcile/database_access_manager.py,sha256=FfyXnYcUdX54BYR_6B9PWFmhT8xdNrPCfoz3Q7q39tg,25646
22
22
  reconcile/deadmanssnitch.py,sha256=n-5W-djUgwzpmdDM4eQIZpkkDmHY0vndt-42LJXI4Y8,7491
23
23
  reconcile/email_sender.py,sha256=-5L-Ag_jaEYSzYRoMr52KQBRXz1E8yx9GqLbg2X4XFU,3533
@@ -188,7 +188,7 @@ reconcile/dynatrace_token_provider/model.py,sha256=gkpqo5rRRueBXnIMjp4EEHqBUBuU6
188
188
  reconcile/dynatrace_token_provider/ocm.py,sha256=MwYCZIxW4f-1jzFTxxN__sity6S8O7bbKUdyTFEVO7U,4325
189
189
  reconcile/dynatrace_token_provider/validate.py,sha256=40_9QmHoB3-KBc0k_0D4QO00PpNNPS-gU9Z6cIcWga8,1920
190
190
  reconcile/endpoints_discovery/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
191
- reconcile/endpoints_discovery/integration.py,sha256=q01DJgCv1YiDY-VUWDfQ5kfGm67BUhP-YP7c0JQObj8,12333
191
+ reconcile/endpoints_discovery/integration.py,sha256=V6uriGAM4Ki9bjTpM2kmRh1UVcyIIFdJK4w0YsorUo8,12704
192
192
  reconcile/endpoints_discovery/merge_request.py,sha256=_yLb4tnvoZMCko8rta2C_CvOInJa9pa3HzSmHNtjgGU,2978
193
193
  reconcile/endpoints_discovery/merge_request_manager.py,sha256=wUMsumxv8RnWaRattax4HfoRlhtVzmgro3GiJJ1C4Vc,6392
194
194
  reconcile/external_resources/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -871,8 +871,8 @@ tools/test/test_qontract_cli.py,sha256=_D61RFGAN5x44CY1tYbouhlGXXABwYfxKSWSQx3Jr
871
871
  tools/test/test_saas_promotion_state.py,sha256=dy4kkSSAQ7bC0Xp2CociETGN-2aABEfL6FU5D9Jl00Y,6056
872
872
  tools/test/test_sd_app_sre_alert_report.py,sha256=v363r9zM7__0kR5K6mvJoGFcM9BvE33fWAayrqkpojA,2116
873
873
  tools/test/test_sre_checkpoints.py,sha256=SKqPPTl9ua0RFdSSofnoQX-JZE6dFLO3LRhfQzqtfh8,2607
874
- qontract_reconcile-0.10.1rc1131.dist-info/METADATA,sha256=2COkT03GzJzpy3Gb1O-srsEwA9GQwzaBMm00k4pPxOI,2213
875
- qontract_reconcile-0.10.1rc1131.dist-info/WHEEL,sha256=eOLhNAGa2EW3wWl_TU484h7q1UNgy0JXjjoqKoxAAQc,92
876
- qontract_reconcile-0.10.1rc1131.dist-info/entry_points.txt,sha256=GKQqCl2j2X1BJQ69een6rHcR26PmnxnONLNOQB-nRjY,491
877
- qontract_reconcile-0.10.1rc1131.dist-info/top_level.txt,sha256=l5ISPoXzt0SdR4jVdkfa7RPSKNc8zAHYWAnR-Dw8Ey8,24
878
- qontract_reconcile-0.10.1rc1131.dist-info/RECORD,,
874
+ qontract_reconcile-0.10.1rc1133.dist-info/METADATA,sha256=-7WqkBwuhgv_OY_C53SD1T0bN9WAMFeIQEZrqGYCUYU,2213
875
+ qontract_reconcile-0.10.1rc1133.dist-info/WHEEL,sha256=eOLhNAGa2EW3wWl_TU484h7q1UNgy0JXjjoqKoxAAQc,92
876
+ qontract_reconcile-0.10.1rc1133.dist-info/entry_points.txt,sha256=GKQqCl2j2X1BJQ69een6rHcR26PmnxnONLNOQB-nRjY,491
877
+ qontract_reconcile-0.10.1rc1133.dist-info/top_level.txt,sha256=l5ISPoXzt0SdR4jVdkfa7RPSKNc8zAHYWAnR-Dw8Ey8,24
878
+ qontract_reconcile-0.10.1rc1133.dist-info/RECORD,,
@@ -1,5 +1,6 @@
1
1
  from collections.abc import Iterable
2
2
  from dataclasses import dataclass
3
+ from math import isnan
3
4
  from typing import Any
4
5
 
5
6
  import jinja2
@@ -83,10 +84,13 @@ class DashdotdbSLO(DashdotdbBase):
83
84
  continue
84
85
 
85
86
  LOG.info("%s syncing slo %s", self.logmarker, slo_name)
86
- response = self._do_post(endpoint, payload)
87
87
  try:
88
+ response = self._do_post(endpoint, payload)
88
89
  response.raise_for_status()
89
- except requests.exceptions.HTTPError as details:
90
+ except (
91
+ requests.exceptions.HTTPError,
92
+ requests.exceptions.InvalidJSONError,
93
+ ) as details:
90
94
  LOG.error("%s error posting %s - %s", self.logmarker, slo_name, details)
91
95
 
92
96
  LOG.info("%s slo %s synced", self.logmarker, slo_name)
@@ -144,6 +148,12 @@ class DashdotdbSLO(DashdotdbBase):
144
148
  continue
145
149
 
146
150
  slo_value = float(slo_value[1])
151
+ if isnan(slo_value):
152
+ LOG.warning(
153
+ f"{self.logmarker} Skipping SLO '{slo.name}' in SLO doc '{slo_document.name}'"
154
+ "as the obtained value is not a number (maybe a division by 0?)"
155
+ )
156
+ continue
147
157
  slo_target = float(slo.slo_target)
148
158
 
149
159
  # In Dash.DB we want to always store SLOs in percentages
@@ -1,4 +1,5 @@
1
1
  import logging
2
+ from collections import defaultdict
2
3
  from collections.abc import Callable, Iterable
3
4
  from typing import TypedDict
4
5
 
@@ -43,7 +44,7 @@ from reconcile.utils.unleash import get_feature_toggle_state
43
44
  from reconcile.utils.vcs import VCS
44
45
 
45
46
  QONTRACT_INTEGRATION = "endpoints-discovery"
46
- QONTRACT_INTEGRATION_VERSION = make_semver(1, 0, 0)
47
+ QONTRACT_INTEGRATION_VERSION = make_semver(1, 0, 1)
47
48
 
48
49
 
49
50
  class EndpointsDiscoveryIntegrationParams(PydanticRunParams):
@@ -137,13 +138,21 @@ class EndpointsDiscoveryIntegration(
137
138
  )
138
139
  return []
139
140
 
141
+ routes = defaultdict(list)
142
+ for item in oc.get_items(kind="Route", namespace=namespace.name):
143
+ tls = bool(item["spec"].get("tls"))
144
+ host = item["spec"]["host"]
145
+ # group all routes with the same hostname/tls
146
+ routes[(host, tls)].append(item["metadata"]["name"])
147
+
148
+ # merge all routes with the same hostname into one and combine the names
140
149
  return [
141
150
  Route(
142
- name=item["metadata"]["name"],
143
- host=item["spec"]["host"],
144
- tls=bool(item["spec"].get("tls")),
151
+ name="|".join(sorted(names)),
152
+ host=host,
153
+ tls=tls,
145
154
  )
146
- for item in oc.get_items(kind="Route", namespace=namespace.name)
155
+ for (host, tls), names in routes.items()
147
156
  ]
148
157
 
149
158
  def get_endpoint_changes(