qontract-reconcile 0.10.2.dev404__py3-none-any.whl → 0.10.2.dev406__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.
Potentially problematic release.
This version of qontract-reconcile might be problematic. Click here for more details.
- {qontract_reconcile-0.10.2.dev404.dist-info → qontract_reconcile-0.10.2.dev406.dist-info}/METADATA +1 -1
- {qontract_reconcile-0.10.2.dev404.dist-info → qontract_reconcile-0.10.2.dev406.dist-info}/RECORD +8 -8
- reconcile/change_owners/change_owners.py +1 -1
- reconcile/openshift_base.py +20 -0
- reconcile/utils/oc.py +20 -11
- reconcile/utils/openshift_resource.py +5 -0
- {qontract_reconcile-0.10.2.dev404.dist-info → qontract_reconcile-0.10.2.dev406.dist-info}/WHEEL +0 -0
- {qontract_reconcile-0.10.2.dev404.dist-info → qontract_reconcile-0.10.2.dev406.dist-info}/entry_points.txt +0 -0
{qontract_reconcile-0.10.2.dev404.dist-info → qontract_reconcile-0.10.2.dev406.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.dev406
|
|
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.dev404.dist-info → qontract_reconcile-0.10.2.dev406.dist-info}/RECORD
RENAMED
|
@@ -54,7 +54,7 @@ reconcile/ocm_groups.py,sha256=gDnkhkYUEoMkI6y6ctyoKIFpJNS18SVnedW4OzJ8VWs,4174
|
|
|
54
54
|
reconcile/ocm_machine_pools.py,sha256=KnTYAOw25N-QRb3Y7zbNY8w8xCR55WyqVjycYz24Yxk,17243
|
|
55
55
|
reconcile/ocm_update_recommended_version.py,sha256=Vi3Y2sX-OQxx1mv_xiPQXnmrpsZzGIE38No0yBcTaD4,4204
|
|
56
56
|
reconcile/ocm_upgrade_scheduler_org_updater.py,sha256=j4qthqx8qREB6mSbV9NT-Giq1Tu5y2EhPgIObkvmjyU,4371
|
|
57
|
-
reconcile/openshift_base.py,sha256=
|
|
57
|
+
reconcile/openshift_base.py,sha256=TTw6da2Efyy5CMxh18CUCtuZgToMnbtszBosflLDkUs,55989
|
|
58
58
|
reconcile/openshift_cluster_bots.py,sha256=POs2kBwKjzD--lElGDQbF7HOuCcOpMEclw4a9usntos,10933
|
|
59
59
|
reconcile/openshift_clusterrolebindings.py,sha256=jwSaYQvUUY7noQGc148Dkqm6woYxvOEd1sume7k_sUk,6212
|
|
60
60
|
reconcile/openshift_groups.py,sha256=XpIyhgnWY1XUQio1wi6sHoDtoMYdk-lpHp0-1d1RC7o,9471
|
|
@@ -162,7 +162,7 @@ reconcile/change_owners/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG
|
|
|
162
162
|
reconcile/change_owners/approver.py,sha256=Z3_11vnK2WNOxjEEXVDh0224-_-qbt9d6mBeVE-7fsc,2259
|
|
163
163
|
reconcile/change_owners/bundle.py,sha256=h30fU-JmLH5a-rCAovpzTeTkkkgZztsZ5A2raee0YuU,5355
|
|
164
164
|
reconcile/change_owners/change_log_tracking.py,sha256=lRHdC6-sqzUClmoVNq8v5rygAzeQJRxbKbJNDB3YI8E,9499
|
|
165
|
-
reconcile/change_owners/change_owners.py,sha256=
|
|
165
|
+
reconcile/change_owners/change_owners.py,sha256=e9ujTibYL5-2Pbf1UuewMFw9Vettfe_WLqiHl4Ad9Y0,17133
|
|
166
166
|
reconcile/change_owners/change_types.py,sha256=5eSvS2_npUriq9RN4LdAWdYUiNzF91K1pDUEVYDIQ4k,32023
|
|
167
167
|
reconcile/change_owners/changes.py,sha256=YTqwUYutQ6JVSSYmC2Ph5ROCiVix42Vnzy47-i57z4Q,18119
|
|
168
168
|
reconcile/change_owners/decision.py,sha256=755rHmrnhfM_xVKnCPlLPOVm_TCJVb3lSkkUvxFM61Q,7491
|
|
@@ -628,12 +628,12 @@ reconcile/utils/make.py,sha256=QaEwucrzbl8-VHS66Wfdjfo0ubmAcvt_hZGpiGsKU50,231
|
|
|
628
628
|
reconcile/utils/metrics.py,sha256=kiOoWO0b0mO-MDZWxyClYz9SeohQ0QU-xji0p-cSiLo,18462
|
|
629
629
|
reconcile/utils/models.py,sha256=N-cOLsLbZAzVazFImue4d1pllCGd_vVcIrFKykYZXZo,4682
|
|
630
630
|
reconcile/utils/oauth2_backend_application_session.py,sha256=6W16sMpnWEPFDUX7qi5Cui2yOnmLfpgUxWtB3Ii35D0,4177
|
|
631
|
-
reconcile/utils/oc.py,sha256=
|
|
631
|
+
reconcile/utils/oc.py,sha256=tk1En7ShB-ny0vKL2tTPvVBHMMZcfdRS4JkTwkZ6mYU,69639
|
|
632
632
|
reconcile/utils/oc_connection_parameters.py,sha256=-H2crz0UOVKWlNrexf04ip8Vu57rE2QZLJuurvin1_c,9705
|
|
633
633
|
reconcile/utils/oc_filters.py,sha256=DXIA2--jlYadPGsKynnnXW_LIZra6N2wmD0MVngir5Y,1427
|
|
634
634
|
reconcile/utils/oc_map.py,sha256=ougQ-Wlsa8ymoE_lPQ7g2LlpsUOsHVeRCLYW_6fjeWU,8976
|
|
635
635
|
reconcile/utils/ocm_base_client.py,sha256=niBN-yHiML5ljqKMOabFTaYW9iQ8JAway37BQF2NvtM,6713
|
|
636
|
-
reconcile/utils/openshift_resource.py,sha256=
|
|
636
|
+
reconcile/utils/openshift_resource.py,sha256=XTFLkaWOjNbkOD5XmCwMGdc9gKbgtKg819pWNcQVfpc,26189
|
|
637
637
|
reconcile/utils/openssl.py,sha256=qdEdSmNXDgx_hhj2psEea6O12cmn3pb4GNhQJtI5l_E,399
|
|
638
638
|
reconcile/utils/output.py,sha256=Rcz9BWaUDLlEWov5NSUSVy5ucx2WKeKNlUddrDjIQtk,2242
|
|
639
639
|
reconcile/utils/pagerduty_api.py,sha256=kPMdegdnb9muL4PttbMVlOAbxMHltMPFLiUyQu6S7wo,7641
|
|
@@ -800,7 +800,7 @@ tools/saas_promotion_state/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJ
|
|
|
800
800
|
tools/saas_promotion_state/saas_promotion_state.py,sha256=uQv2QJAmUXP1g2GPIH30WTlvL9soY6m9lefpZEVDM5w,3965
|
|
801
801
|
tools/sre_checkpoints/__init__.py,sha256=CDaDaywJnmRCLyl_NCcvxi-Zc0hTi_3OdwKiFOyS39I,145
|
|
802
802
|
tools/sre_checkpoints/util.py,sha256=KcYVfa3UmJHVP_ocgrKe8NkrO5IDB9aWEDydSokPcRk,975
|
|
803
|
-
qontract_reconcile-0.10.2.
|
|
804
|
-
qontract_reconcile-0.10.2.
|
|
805
|
-
qontract_reconcile-0.10.2.
|
|
806
|
-
qontract_reconcile-0.10.2.
|
|
803
|
+
qontract_reconcile-0.10.2.dev406.dist-info/METADATA,sha256=FWPHfQFsB0Ne8mEHAmD6ndESIZmPM78am7UxYl5MkBc,24946
|
|
804
|
+
qontract_reconcile-0.10.2.dev406.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
805
|
+
qontract_reconcile-0.10.2.dev406.dist-info/entry_points.txt,sha256=5i9l54La3vQrDLAdwDKQWC0iG4sV9RRfOb1BpvzOWLc,698
|
|
806
|
+
qontract_reconcile-0.10.2.dev406.dist-info/RECORD,,
|
|
@@ -140,7 +140,7 @@ def write_coverage_report_to_mr(
|
|
|
140
140
|
approver_reachability = set()
|
|
141
141
|
for d in change_decisions:
|
|
142
142
|
approvers = [
|
|
143
|
-
f"{cr.context} - {' '.join([f'@{a.org_username}' if a.tag_on_merge_requests else a.org_username for a in cr.approvers])}"
|
|
143
|
+
f"{cr.context} - {' '.join([f'@{a.org_username}' if (a.tag_on_merge_requests or len(cr.approvers) == 1) else a.org_username for a in cr.approvers])}"
|
|
144
144
|
for cr in d.change_responsibles
|
|
145
145
|
]
|
|
146
146
|
if d.coverable_by_fragment_decisions:
|
reconcile/openshift_base.py
CHANGED
|
@@ -30,9 +30,11 @@ from reconcile.utils import (
|
|
|
30
30
|
)
|
|
31
31
|
from reconcile.utils.constants import DEFAULT_THREAD_POOL_SIZE
|
|
32
32
|
from reconcile.utils.oc import (
|
|
33
|
+
AmbiguousResourceTypeError,
|
|
33
34
|
DeploymentFieldIsImmutableError,
|
|
34
35
|
FieldIsImmutableError,
|
|
35
36
|
InvalidValueApplyError,
|
|
37
|
+
KindNotFoundError,
|
|
36
38
|
MayNotChangeOnceSetError,
|
|
37
39
|
MetaDataAnnotationsTooLongApplyError,
|
|
38
40
|
OC_Map,
|
|
@@ -188,6 +190,24 @@ def init_specs_to_fetch(
|
|
|
188
190
|
continue
|
|
189
191
|
|
|
190
192
|
managed_resource_names = namespace_info.get("managedResourceNames") or []
|
|
193
|
+
try:
|
|
194
|
+
validate_managed_resource_types(
|
|
195
|
+
oc,
|
|
196
|
+
managed_types,
|
|
197
|
+
managed_resource_names,
|
|
198
|
+
cluster_scope_resource_validation=cluster_scope_resource_validation,
|
|
199
|
+
)
|
|
200
|
+
except KindNotFoundError:
|
|
201
|
+
# We must allow kinds that are not supported by the cluster because:
|
|
202
|
+
# 1. We install CRD with an operator in the same MR
|
|
203
|
+
# 2. SAAS files initialize the namespace objects with managedResourceTypes from the SAAS file
|
|
204
|
+
# and we can't expect that all of those are valid for all clusters
|
|
205
|
+
pass
|
|
206
|
+
except (AmbiguousResourceTypeError, ValidationError) as e:
|
|
207
|
+
ri.register_error()
|
|
208
|
+
logging.error(f"[{cluster}/{namespace_info['name']}] {e}")
|
|
209
|
+
continue
|
|
210
|
+
|
|
191
211
|
namespace = namespace_info["name"]
|
|
192
212
|
# These may exit but have a value of None
|
|
193
213
|
managed_resource_type_overrides = (
|
reconcile/utils/oc.py
CHANGED
|
@@ -146,6 +146,14 @@ class RequestEntityTooLargeError(Exception):
|
|
|
146
146
|
pass
|
|
147
147
|
|
|
148
148
|
|
|
149
|
+
class KindNotFoundError(Exception):
|
|
150
|
+
pass
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
class AmbiguousResourceTypeError(Exception):
|
|
154
|
+
pass
|
|
155
|
+
|
|
156
|
+
|
|
149
157
|
class OCDecorators:
|
|
150
158
|
@classmethod
|
|
151
159
|
def process_reconcile_time(cls, function: Callable) -> Callable:
|
|
@@ -1232,7 +1240,7 @@ class OCCli:
|
|
|
1232
1240
|
try:
|
|
1233
1241
|
self.get_api_resource(kind)
|
|
1234
1242
|
return True
|
|
1235
|
-
except
|
|
1243
|
+
except KindNotFoundError:
|
|
1236
1244
|
return False
|
|
1237
1245
|
|
|
1238
1246
|
def is_kind_namespaced(self, kind: str) -> bool:
|
|
@@ -1253,25 +1261,26 @@ class OCCli:
|
|
|
1253
1261
|
kind, group, _ = self.parse_kind(kind)
|
|
1254
1262
|
|
|
1255
1263
|
if not (resources := self.api_resources.get(kind)):
|
|
1256
|
-
|
|
1264
|
+
# the kind not found at all
|
|
1265
|
+
raise KindNotFoundError(f"Unsupported resource type: {kind}")
|
|
1257
1266
|
|
|
1258
1267
|
if len(resources) == 1 and group == DEFAULT_GROUP:
|
|
1259
1268
|
return resources[0]
|
|
1260
1269
|
|
|
1261
|
-
resource
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1270
|
+
# get the resource with the specified group
|
|
1271
|
+
if resource := next((r for r in resources if r.group == group), None):
|
|
1272
|
+
return resource
|
|
1273
|
+
|
|
1274
|
+
# no resource with the specified group found
|
|
1275
|
+
if group == DEFAULT_GROUP:
|
|
1266
1276
|
message = (
|
|
1267
1277
|
f"Ambiguous resource type: {kind}. "
|
|
1268
1278
|
"Please fully qualify it with its API group. E.g., ClusterRoleBinding -> ClusterRoleBinding.rbac.authorization.k8s.io"
|
|
1269
|
-
if group == DEFAULT_GROUP
|
|
1270
|
-
else f"Unsupported resource type: {kind}"
|
|
1271
1279
|
)
|
|
1272
|
-
raise
|
|
1280
|
+
raise AmbiguousResourceTypeError(message)
|
|
1273
1281
|
|
|
1274
|
-
|
|
1282
|
+
# group was specified but no matching resource found
|
|
1283
|
+
raise KindNotFoundError(f"Unsupported resource type: {kind}")
|
|
1275
1284
|
|
|
1276
1285
|
|
|
1277
1286
|
REQUEST_TIMEOUT = 60
|
|
@@ -5,6 +5,7 @@ import base64
|
|
|
5
5
|
import contextlib
|
|
6
6
|
import copy
|
|
7
7
|
import hashlib
|
|
8
|
+
import logging
|
|
8
9
|
import re
|
|
9
10
|
from threading import Lock
|
|
10
11
|
from typing import TYPE_CHECKING, Any
|
|
@@ -601,6 +602,10 @@ class ResourceInventory:
|
|
|
601
602
|
resource: OpenshiftResource,
|
|
602
603
|
privileged: bool = False,
|
|
603
604
|
) -> None:
|
|
605
|
+
if cluster not in self._clusters:
|
|
606
|
+
logging.error(f"Cluster {cluster} not initialized in ResourceInventory")
|
|
607
|
+
return
|
|
608
|
+
|
|
604
609
|
if resource.kind_and_group in self._clusters[cluster][namespace]:
|
|
605
610
|
kind = resource.kind_and_group
|
|
606
611
|
else:
|
{qontract_reconcile-0.10.2.dev404.dist-info → qontract_reconcile-0.10.2.dev406.dist-info}/WHEEL
RENAMED
|
File without changes
|
|
File without changes
|