qontract-reconcile 0.10.2.dev97__py3-none-any.whl → 0.10.2.dev98__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.
- {qontract_reconcile-0.10.2.dev97.dist-info → qontract_reconcile-0.10.2.dev98.dist-info}/METADATA +1 -1
- {qontract_reconcile-0.10.2.dev97.dist-info → qontract_reconcile-0.10.2.dev98.dist-info}/RECORD +6 -6
- reconcile/dynatrace_token_provider/integration.py +3 -3
- reconcile/dynatrace_token_provider/ocm.py +10 -21
- {qontract_reconcile-0.10.2.dev97.dist-info → qontract_reconcile-0.10.2.dev98.dist-info}/WHEEL +0 -0
- {qontract_reconcile-0.10.2.dev97.dist-info → qontract_reconcile-0.10.2.dev98.dist-info}/entry_points.txt +0 -0
{qontract_reconcile-0.10.2.dev97.dist-info → qontract_reconcile-0.10.2.dev98.dist-info}/METADATA
RENAMED
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: qontract-reconcile
|
3
|
-
Version: 0.10.2.
|
3
|
+
Version: 0.10.2.dev98
|
4
4
|
Summary: Collection of tools to reconcile services with their desired state as defined in the app-interface DB.
|
5
5
|
Project-URL: homepage, https://github.com/app-sre/qontract-reconcile
|
6
6
|
Project-URL: repository, https://github.com/app-sre/qontract-reconcile
|
{qontract_reconcile-0.10.2.dev97.dist-info → qontract_reconcile-0.10.2.dev98.dist-info}/RECORD
RENAMED
@@ -185,10 +185,10 @@ reconcile/cna/assets/asset_factory.py,sha256=7T7X_J6xIsoGETqBRI45_EyIKEdQcnRPt_G
|
|
185
185
|
reconcile/cna/assets/null.py,sha256=85mVh97atCoC0aLuX47poTZiyOthmziJeBsUw0c924w,1658
|
186
186
|
reconcile/dynatrace_token_provider/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
187
187
|
reconcile/dynatrace_token_provider/dependencies.py,sha256=FuRUnK18EyJIIgFwQBZSskIG08mN2VQAcAcaJFTf8zc,2812
|
188
|
-
reconcile/dynatrace_token_provider/integration.py,sha256=
|
188
|
+
reconcile/dynatrace_token_provider/integration.py,sha256=RmptOa5CYrKNMZqCQhmP_AsC3L-BCKhjmM8otj6a7OY,26514
|
189
189
|
reconcile/dynatrace_token_provider/metrics.py,sha256=oP-6NTZENFdvWiS0krnmX6tq3xyOzQ8e6vS0CZWYUuw,1496
|
190
190
|
reconcile/dynatrace_token_provider/model.py,sha256=gkpqo5rRRueBXnIMjp4EEHqBUBuU65TRI8zpdb8GJ0A,241
|
191
|
-
reconcile/dynatrace_token_provider/ocm.py,sha256=
|
191
|
+
reconcile/dynatrace_token_provider/ocm.py,sha256=bryaK7xs7ygttUyZuSD9Up4laUhP6OUTr2VBbFiclpA,4298
|
192
192
|
reconcile/dynatrace_token_provider/validate.py,sha256=40_9QmHoB3-KBc0k_0D4QO00PpNNPS-gU9Z6cIcWga8,1920
|
193
193
|
reconcile/endpoints_discovery/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
194
194
|
reconcile/endpoints_discovery/integration.py,sha256=ecjIZK_h6JO2wUhUmJlZ9pjOh60nS5aenEWGDj6YJdw,14790
|
@@ -786,7 +786,7 @@ tools/saas_promotion_state/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJ
|
|
786
786
|
tools/saas_promotion_state/saas_promotion_state.py,sha256=UfwwRLS5Ya4_Nh1w5n1dvoYtchQvYE9yj1VANt2IKqI,3925
|
787
787
|
tools/sre_checkpoints/__init__.py,sha256=CDaDaywJnmRCLyl_NCcvxi-Zc0hTi_3OdwKiFOyS39I,145
|
788
788
|
tools/sre_checkpoints/util.py,sha256=zEDbGr18ZeHNQwW8pUsr2JRjuXIPz--WAGJxZo9sv_Y,894
|
789
|
-
qontract_reconcile-0.10.2.
|
790
|
-
qontract_reconcile-0.10.2.
|
791
|
-
qontract_reconcile-0.10.2.
|
792
|
-
qontract_reconcile-0.10.2.
|
789
|
+
qontract_reconcile-0.10.2.dev98.dist-info/METADATA,sha256=MejCD_NtyQK68CSmDQ5laTsLKIDzMVDVp_YkPtbRvMs,24565
|
790
|
+
qontract_reconcile-0.10.2.dev98.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
791
|
+
qontract_reconcile-0.10.2.dev98.dist-info/entry_points.txt,sha256=5i9l54La3vQrDLAdwDKQWC0iG4sV9RRfOb1BpvzOWLc,698
|
792
|
+
qontract_reconcile-0.10.2.dev98.dist-info/RECORD,,
|
@@ -16,7 +16,7 @@ from reconcile.dynatrace_token_provider.metrics import (
|
|
16
16
|
from reconcile.dynatrace_token_provider.model import DynatraceAPIToken, K8sSecret
|
17
17
|
from reconcile.dynatrace_token_provider.ocm import (
|
18
18
|
DTP_LABEL_SEARCH,
|
19
|
-
|
19
|
+
DTP_TENANT_V2_LABEL,
|
20
20
|
Cluster,
|
21
21
|
OCMClient,
|
22
22
|
)
|
@@ -172,10 +172,10 @@ class DynatraceTokenProviderIntegration(QontractReconcileIntegration[NoParams]):
|
|
172
172
|
_expose_errors_as_service_log(
|
173
173
|
ocm_client,
|
174
174
|
cluster_uuid=cluster.external_id,
|
175
|
-
error=f"Missing label {
|
175
|
+
error=f"Missing label {DTP_TENANT_V2_LABEL}",
|
176
176
|
)
|
177
177
|
logging.warn(
|
178
|
-
f"[{cluster.id=}] Missing value for label {
|
178
|
+
f"[{cluster.id=}] Missing value for label {DTP_TENANT_V2_LABEL}"
|
179
179
|
)
|
180
180
|
continue
|
181
181
|
if (
|
@@ -1,5 +1,6 @@
|
|
1
1
|
from __future__ import annotations
|
2
2
|
|
3
|
+
import logging
|
3
4
|
from collections.abc import Mapping
|
4
5
|
from datetime import timedelta
|
5
6
|
from typing import Any
|
@@ -34,10 +35,7 @@ from reconcile.utils.ocm_base_client import (
|
|
34
35
|
Thin abstractions of reconcile.ocm module to reduce coupling.
|
35
36
|
"""
|
36
37
|
|
37
|
-
DTP_TENANT_LABEL = sre_capability_label_key("dtp", "tenant")
|
38
|
-
DTP_SPEC_LABEL = sre_capability_label_key("dtp", "token-spec")
|
39
38
|
DTP_LABEL_SEARCH = sre_capability_label_key("dtp", "%")
|
40
|
-
|
41
39
|
DTP_TENANT_V2_LABEL = sre_capability_label_key("dtp.v2", "tenant")
|
42
40
|
DTP_SPEC_V2_LABEL = sre_capability_label_key("dtp.v2", "token-spec")
|
43
41
|
|
@@ -51,24 +49,14 @@ class Cluster(BaseModel):
|
|
51
49
|
is_hcp: bool
|
52
50
|
|
53
51
|
@staticmethod
|
54
|
-
def from_cluster_details(cluster: ClusterDetails) -> Cluster:
|
52
|
+
def from_cluster_details(cluster: ClusterDetails) -> Cluster | None:
|
55
53
|
dt_tenant = cluster.labels.get_label_value(DTP_TENANT_V2_LABEL)
|
56
54
|
token_spec_name = cluster.labels.get_label_value(DTP_SPEC_V2_LABEL)
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
token_spec_name = cluster.labels.get_label_value(DTP_SPEC_LABEL)
|
63
|
-
if not token_spec_name:
|
64
|
-
"""
|
65
|
-
We want to stay backwards compatible.
|
66
|
-
Earlier version of DTP did not set a value for the label.
|
67
|
-
We fall back to a default token in that case.
|
68
|
-
|
69
|
-
Long-term, we want to remove this behavior.
|
70
|
-
"""
|
71
|
-
token_spec_name = "hypershift-management-cluster-v1"
|
55
|
+
if not dt_tenant or not token_spec_name:
|
56
|
+
logging.warning(
|
57
|
+
f"[Missing DTP labels] {cluster.ocm_cluster.id=} {cluster.ocm_cluster.subscription.id=} {dt_tenant=} {token_spec_name=}"
|
58
|
+
)
|
59
|
+
return None
|
72
60
|
return Cluster(
|
73
61
|
id=cluster.ocm_cluster.id,
|
74
62
|
external_id=cluster.ocm_cluster.external_id,
|
@@ -131,10 +119,11 @@ class OCMClient:
|
|
131
119
|
|
132
120
|
def discover_clusters_by_labels(self, label_filter: Filter) -> list[Cluster]:
|
133
121
|
return [
|
134
|
-
|
135
|
-
for
|
122
|
+
cluster
|
123
|
+
for ocm_cluster in discover_clusters_by_labels(
|
136
124
|
ocm_api=self._ocm_client, label_filter=label_filter
|
137
125
|
)
|
126
|
+
if (cluster := Cluster.from_cluster_details(ocm_cluster))
|
138
127
|
]
|
139
128
|
|
140
129
|
def create_service_log(
|
{qontract_reconcile-0.10.2.dev97.dist-info → qontract_reconcile-0.10.2.dev98.dist-info}/WHEEL
RENAMED
File without changes
|
File without changes
|