qontract-reconcile 0.10.1rc756__py3-none-any.whl → 0.10.1rc758__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.1rc756
3
+ Version: 0.10.1rc758
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
@@ -54,7 +54,7 @@ reconcile/mr_client_gateway.py,sha256=WhjMd-sIXDFCV8-rt8CEjurJ5OYB1pOD0K3o0tZRXQ
54
54
  reconcile/ocm_additional_routers.py,sha256=KfcFDVbNoc6n5dHWjYdAf1_DiVqVG6Tw23WLKoV8cdg,3306
55
55
  reconcile/ocm_addons.py,sha256=qqAyqRBRbdZQvAcjb-QlSVyRAyQBZk6iVlgnI4jyi7s,3353
56
56
  reconcile/ocm_addons_upgrade_tests_trigger.py,sha256=L1ktYynIR7pmHiYtdCTdLGJRKX72B54KUAuPLOccXzo,3995
57
- reconcile/ocm_aws_infrastructure_access.py,sha256=TjpQYE61wbHTAWGHkGnHzLQh31-pAzM8FC_Il53BpAI,7141
57
+ reconcile/ocm_aws_infrastructure_access.py,sha256=kDnJP6aOFO263LSbdCxJMmUwVsM3LgdzebtIUOoIhH8,7130
58
58
  reconcile/ocm_clusters.py,sha256=YWfBF25E55Odm0L3dXnqRbC_bDuYIsBPg4j6DEpWCGw,16703
59
59
  reconcile/ocm_external_configuration_labels.py,sha256=imEpDv1RBpCSj8tHDv0R76hmNCFtcUzVNgS1yOVl8vs,3870
60
60
  reconcile/ocm_github_idp.py,sha256=glwXMsIBcl38-OmDDQCpe0YoLLXfoRgVQmqwXMEXjds,3946
@@ -105,7 +105,7 @@ reconcile/service_dependencies.py,sha256=PMKP9vc6oL-78rzyF_RE8DzLSQMSqN8vCqt9sWp
105
105
  reconcile/signalfx_endpoint_monitoring.py,sha256=D1m8iq0EAKie0OD59FOcVCtpWWZ7xlo6lwBS9urwMIk,2894
106
106
  reconcile/slack_base.py,sha256=K3fSYx46G1djoPb07_C9j6ChhMCt5LgV5l6v2TFkNZk,3479
107
107
  reconcile/slack_usergroups.py,sha256=XC7bYHP322EFWrEaR4Orw_sOoMFmuV3o08OC0UE4xLQ,27592
108
- reconcile/sql_query.py,sha256=zZkihfI-f0JjMez9A83HGTlVwqqbkP8lLjRg-z7sOUU,25878
108
+ reconcile/sql_query.py,sha256=FAQI9EIHsokZBbGwvGU4vnjg1fHemxpYQE20UtCB1qo,25941
109
109
  reconcile/status.py,sha256=cY4IJFXemhxptRJqR4qaaOWqei9e4jgLXuVSGajMsjg,544
110
110
  reconcile/status_board.py,sha256=nA74_133jukxVShjPKJpkXOA3vggDTTEhYTegoXbN1M,8632
111
111
  reconcile/terraform_aws_route53.py,sha256=R8eZHlvP368nvtmLd_cMSK3RGxD7jso9qE7NP92iniU,9986
@@ -122,7 +122,7 @@ reconcile/vpc_peerings_validator.py,sha256=Kv22HJVlTW9l9GB2eXwjPWqdDbr_VuvQBNPtt
122
122
  reconcile/aus/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
123
123
  reconcile/aus/advanced_upgrade_service.py,sha256=MPqcWpq1QeYzBsB8rtTlo102h_cR_q83oOYtWAncuAk,22391
124
124
  reconcile/aus/aus_label_source.py,sha256=qoP8Fgxuu1tCuhG6ixCWve7Ll-KD6a79E2uLAmC0ifw,4184
125
- reconcile/aus/base.py,sha256=RqFUwH2xiWFN1U6plp-UG77iFkK60b8YKODsD4YWWyc,49880
125
+ reconcile/aus/base.py,sha256=89tNKGZAsfCiYivF-oU15nois91eP4b8tRRT45zaY9M,49886
126
126
  reconcile/aus/cluster_version_data.py,sha256=j4UyEBi5mQuvPq5Lo7a_L_0blxvH790wJV07uAiikFU,7126
127
127
  reconcile/aus/healthchecks.py,sha256=S8_KPn_zFiOo_wf5XlVmz-I3tUDYAim3EGSqiSPMvLQ,2707
128
128
  reconcile/aus/metrics.py,sha256=nKT4m2zGT-QOMR0c-z-npVNKWsNMubzdffpU_f9n4II,3927
@@ -473,10 +473,10 @@ reconcile/test/test_make.py,sha256=zTdjgq-3idFlec_0qJenk9wWw0QMLvSpJfPsptXmync,6
473
473
  reconcile/test/test_ocm_additional_routers.py,sha256=dtbpUnD5un6Q3VoLbuFRb_njmt5SSCnBzvSSBcO_Xxs,4248
474
474
  reconcile/test/test_ocm_clusters.py,sha256=aBzL3eW_g3bTP2wmKE1hr8-f33OOhBiKDxJ0fNxWGCQ,23888
475
475
  reconcile/test/test_ocm_clusters_manifest_updates.py,sha256=jFRVfc5jby1kI2x_gT6wcqPPgkav1et9wZH6JqQbNSY,3278
476
- reconcile/test/test_ocm_machine_pools.py,sha256=3qo6t2Jfr1Wee0NUacyLTDmatp0o7CUNpkVOpHiOiGk,29737
476
+ reconcile/test/test_ocm_machine_pools.py,sha256=X4S5lksvljAgCMSW7fDGguc6JMtNQ0bO2WAoLC2AAJw,29737
477
477
  reconcile/test/test_ocm_update_recommended_version.py,sha256=iA4BVirTGVXlwcOyeR52IuNO81X_8NR6ZNd7ZFE7igs,4328
478
478
  reconcile/test/test_ocm_upgrade_scheduler_org_updater.py,sha256=V91g2XQMa2nvKwkLVWkiPwNL6pMQE16s4jO0oXJ6wdk,4330
479
- reconcile/test/test_openshift_base.py,sha256=uVsnMghAQhHaJTreeOw4x2INTKJ6qeiZiiteWeKflW8,33874
479
+ reconcile/test/test_openshift_base.py,sha256=YgTKcLmzmt9oR12s_022LAp9qr1R_CBOppYwoknspzE,33868
480
480
  reconcile/test/test_openshift_cluster_bots.py,sha256=L-yuKvMgB0LBCdfLu7wozh_lk6S_m3umXt3m_ECfLEI,8023
481
481
  reconcile/test/test_openshift_namespace_labels.py,sha256=P1hqi6P88NijNrurdXG_QR2usyo3EYZSy9zpwYHvDsM,12104
482
482
  reconcile/test/test_openshift_namespaces.py,sha256=HmRnCE5EnFt3MYceVEFHmk8wWRtCrxu2AFGFkY9pdyA,9214
@@ -501,7 +501,7 @@ reconcile/test/test_secret_reader.py,sha256=kz7nzcPjvA08cytnvcA_PMA98AEyqJWsESkY
501
501
  reconcile/test/test_slack_base.py,sha256=gpbWOLNxMMX6fyAbs1JakhLTnwfedb3f7WpUae4tQZE,5060
502
502
  reconcile/test/test_slack_usergroups.py,sha256=UO-OzqbGMSpNsyddu2TbWOzSiVze6Bq95Ph1QIJqLWY,23990
503
503
  reconcile/test/test_sql_query.py,sha256=rC-lf1_isT9i2ZIV9W0hkUkLi2oBIjZMRMhk-6mV-34,11029
504
- reconcile/test/test_status_board.py,sha256=WdAq4pFoWWqcOcfgMzssZD3xfvT1QLrEHJqUARldtvA,7875
504
+ reconcile/test/test_status_board.py,sha256=go3YSWo03OLIdK95SuiDJa1Nqk-eN_9QtS7dfmu9__8,7875
505
505
  reconcile/test/test_terraform_aws_route53.py,sha256=xHggb8K1P76OyCfFcogbkmyKle-NlUylcbDnuv3IqvY,771
506
506
  reconcile/test/test_terraform_cloudflare_dns.py,sha256=aQTXX8Vr4h9aWvJZTnpZEhMGYoBpT2d45ZxU_ECIQ6o,3425
507
507
  reconcile/test/test_terraform_cloudflare_resources.py,sha256=NK_uktyWihkQ3gMN4bCaKerpi43CXAVYGIKTfcz05rY,13550
@@ -721,7 +721,7 @@ reconcile/utils/mr/ocm_upgrade_scheduler_org_updates.py,sha256=RzEKRT_BhvB2ud9py
721
721
  reconcile/utils/mr/user_maintenance.py,sha256=cHPBn8zrReWLHalyk-EFdkFJe9zjVjRoZhT4t2zZfGE,3956
722
722
  reconcile/utils/ocm/__init__.py,sha256=xv7CJp7K9LCQfa4gL_W0MMCOD1P4qOy8t5aZj1xXNUE,808
723
723
  reconcile/utils/ocm/addons.py,sha256=IHlqOO12TAdYwwU6Oedz3ussF1kELj9EI5GxPP6LKi8,7376
724
- reconcile/utils/ocm/base.py,sha256=sdcINGBy1FlotY0MZuVC--Yn3zcYDn_N33ownMD8SQE,14030
724
+ reconcile/utils/ocm/base.py,sha256=KPS1CgiALlq7INdgTDpN7MmtZ6uQMSWcUDjeGHmp5Z4,14065
725
725
  reconcile/utils/ocm/cluster_groups.py,sha256=F8oqVqN_4QUnGL0K61zZhoYIzJeP57EcmZpwmoV0mr4,1751
726
726
  reconcile/utils/ocm/clusters.py,sha256=Nw9m-jgN3GHHCh6w9UOBbMV4rtS24_-Ep09jAWQ-_fE,7653
727
727
  reconcile/utils/ocm/identity_providers.py,sha256=dKed09N8iWmn39tI_MpwgVe47x23eLsknGbjMUxtwr4,2175
@@ -783,8 +783,8 @@ tools/test/test_app_interface_metrics_exporter.py,sha256=SX7qL3D1SIRKFo95FoQztvf
783
783
  tools/test/test_qontract_cli.py,sha256=w2l4BHB09k1d-BGJ1jBUNCqDv7zkqYrMHojQXg-21kQ,4155
784
784
  tools/test/test_sd_app_sre_alert_report.py,sha256=v363r9zM7__0kR5K6mvJoGFcM9BvE33fWAayrqkpojA,2116
785
785
  tools/test/test_sre_checkpoints.py,sha256=SKqPPTl9ua0RFdSSofnoQX-JZE6dFLO3LRhfQzqtfh8,2607
786
- qontract_reconcile-0.10.1rc756.dist-info/METADATA,sha256=e3uCbsaVAAU1U51hxqtUNTNVP_7hwDox4K9PcBo6J_c,2382
787
- qontract_reconcile-0.10.1rc756.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
788
- qontract_reconcile-0.10.1rc756.dist-info/entry_points.txt,sha256=rIxI5zWtHNlfpDeq1a7pZXAPoqf7HG32KMTN3MeWK_8,429
789
- qontract_reconcile-0.10.1rc756.dist-info/top_level.txt,sha256=l5ISPoXzt0SdR4jVdkfa7RPSKNc8zAHYWAnR-Dw8Ey8,24
790
- qontract_reconcile-0.10.1rc756.dist-info/RECORD,,
786
+ qontract_reconcile-0.10.1rc758.dist-info/METADATA,sha256=AV5BARka8wT3N8-xnQvmBspzkrCa7ewkyMWLaQ2xb-s,2382
787
+ qontract_reconcile-0.10.1rc758.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
788
+ qontract_reconcile-0.10.1rc758.dist-info/entry_points.txt,sha256=rIxI5zWtHNlfpDeq1a7pZXAPoqf7HG32KMTN3MeWK_8,429
789
+ qontract_reconcile-0.10.1rc758.dist-info/top_level.txt,sha256=l5ISPoXzt0SdR4jVdkfa7RPSKNc8zAHYWAnR-Dw8Ey8,24
790
+ qontract_reconcile-0.10.1rc758.dist-info/RECORD,,
reconcile/aus/base.py CHANGED
@@ -850,8 +850,8 @@ def is_gate_applicable_to_cluster(gate: OCMVersionGate, cluster: OCMCluster) ->
850
850
  # consider only gates after the clusters current minor version
851
851
  # OCM onls supports creating gate agreements for later minor versions than the
852
852
  # current cluster version
853
- if not semver.match(
854
- f"{cluster.minor_version()}.0", f"<{gate.version_raw_id_prefix}.0"
853
+ if not parse_semver(f"{cluster.minor_version()}.0").match(
854
+ f"<{gate.version_raw_id_prefix}.0"
855
855
  ):
856
856
  return False
857
857
 
@@ -140,7 +140,7 @@ def act(
140
140
  dry_run, ocm_map, current_state, current_failed, desired_state, current_deleting
141
141
  ):
142
142
  to_delete = [c for c in current_state if c not in desired_state]
143
- to_delete = to_delete + current_failed
143
+ to_delete += current_failed
144
144
  for item in to_delete:
145
145
  cluster = item["cluster"]
146
146
  user_arn = item["user_arn"]
reconcile/sql_query.py CHANGED
@@ -15,7 +15,6 @@ from typing import (
15
15
  )
16
16
 
17
17
  import jinja2
18
- from ruamel import yaml
19
18
 
20
19
  from reconcile import (
21
20
  openshift_base,
@@ -34,6 +33,7 @@ from reconcile.utils.openshift_resource import (
34
33
  OpenshiftResource,
35
34
  ResourceInventory,
36
35
  )
36
+ from reconcile.utils.ruamel import create_ruamel_instance
37
37
  from reconcile.utils.secret_reader import SecretReader
38
38
  from reconcile.utils.semver_helper import make_semver
39
39
  from reconcile.utils.smtp_client import (
@@ -591,6 +591,7 @@ def _build_openshift_resources(
591
591
  query_name = query["name"]
592
592
  common_resource_labels = _build_common_resource_labels(query)
593
593
  openshift_resources: list[OpenshiftResource] = []
594
+ yml = create_ruamel_instance()
594
595
  if pull_secret:
595
596
  labels = pull_secret["labels"] or {}
596
597
  labels.update(common_resource_labels)
@@ -651,7 +652,7 @@ def _build_openshift_resources(
651
652
  )
652
653
  openshift_resources.append(
653
654
  OpenshiftResource(
654
- body=yaml.safe_load(job_yaml),
655
+ body=yml.load(job_yaml),
655
656
  integration=QONTRACT_INTEGRATION,
656
657
  integration_version=QONTRACT_INTEGRATION_VERSION,
657
658
  )
@@ -32,7 +32,7 @@ from reconcile.ocm_machine_pools import (
32
32
  from reconcile.utils.ocm import OCM
33
33
 
34
34
 
35
- class TestPool(AbstractPool):
35
+ class PoolStub(AbstractPool):
36
36
  created = False
37
37
  deleted = False
38
38
  updated = False
@@ -57,8 +57,8 @@ class TestPool(AbstractPool):
57
57
 
58
58
 
59
59
  @pytest.fixture
60
- def test_pool() -> TestPool:
61
- return TestPool(
60
+ def test_pool() -> PoolStub:
61
+ return PoolStub(
62
62
  id="pool1",
63
63
  replicas=2,
64
64
  labels=None,
@@ -133,7 +133,7 @@ def ocm_mock():
133
133
 
134
134
 
135
135
  def test_diff__has_diff_autoscale(cluster_machine_pool: ClusterMachinePoolV1):
136
- pool = TestPool(id="pool1", cluster="cluster1", cluster_type=ClusterType.OSD)
136
+ pool = PoolStub(id="pool1", cluster="cluster1", cluster_type=ClusterType.OSD)
137
137
 
138
138
  assert cluster_machine_pool.autoscale is None
139
139
  assert not pool._has_diff_autoscale(cluster_machine_pool)
@@ -766,7 +766,7 @@ def build_openshift_resource(
766
766
  "metadata": {"name": name},
767
767
  }
768
768
  if extra_body:
769
- body = body | extra_body
769
+ body |= extra_body
770
770
 
771
771
  return resource.OpenshiftResource(
772
772
  body=body,
@@ -18,7 +18,7 @@ from reconcile.status_board import (
18
18
  from reconcile.utils.ocm_base_client import OCMBaseClient
19
19
 
20
20
 
21
- class TestStatusBoard(AbstractStatusBoard):
21
+ class StatusBoardStub(AbstractStatusBoard):
22
22
  created: Optional[bool] = False
23
23
  deleted: Optional[bool] = False
24
24
  summarized: Optional[bool] = False
@@ -99,21 +99,21 @@ def test_status_board_handler(mocker: MockerFixture) -> None:
99
99
  ocm = mocker.patch("reconcile.status_board.OCMBaseClient")
100
100
  h = StatusBoardHandler(
101
101
  action="create",
102
- status_board_object=TestStatusBoard(name="foo", fullname="foo"),
102
+ status_board_object=StatusBoardStub(name="foo", fullname="foo"),
103
103
  )
104
104
 
105
105
  h.act(dry_run=False, ocm=ocm)
106
- assert isinstance(h.status_board_object, TestStatusBoard)
106
+ assert isinstance(h.status_board_object, StatusBoardStub)
107
107
  assert h.status_board_object.created
108
108
  assert h.status_board_object.summarized
109
109
 
110
110
  h = StatusBoardHandler(
111
111
  action="delete",
112
- status_board_object=TestStatusBoard(name="foo", fullname="foo"),
112
+ status_board_object=StatusBoardStub(name="foo", fullname="foo"),
113
113
  )
114
114
 
115
115
  h.act(dry_run=False, ocm=ocm)
116
- assert isinstance(h.status_board_object, TestStatusBoard)
116
+ assert isinstance(h.status_board_object, StatusBoardStub)
117
117
  assert h.status_board_object.deleted
118
118
  assert h.status_board_object.summarized
119
119
 
@@ -8,13 +8,13 @@ from typing import (
8
8
  TypeVar,
9
9
  )
10
10
 
11
- import semver
12
11
  from pydantic import (
13
12
  BaseModel,
14
13
  Field,
15
14
  )
16
15
 
17
16
  from reconcile.utils.aws_helper import get_account_uid_from_arn, get_role_name_from_arn
17
+ from reconcile.utils.semver_helper import parse_semver
18
18
 
19
19
  LabelSetTypeVar = TypeVar("LabelSetTypeVar", bound=BaseModel)
20
20
  ACTIVE_SUBSCRIPTION_STATES = {"Active", "Reserved"}
@@ -246,8 +246,8 @@ class OCMCluster(BaseModel):
246
246
  external_configuration: Optional[OCMExternalConfiguration]
247
247
 
248
248
  def minor_version(self) -> str:
249
- version_info = semver.parse(self.version.raw_id)
250
- return f"{version_info['major']}.{version_info['minor']}"
249
+ version_info = parse_semver(self.version.raw_id)
250
+ return f"{version_info.major}.{version_info.minor}"
251
251
 
252
252
  def available_upgrades(self) -> list[str]:
253
253
  return self.version.available_upgrades