qontract-reconcile 0.10.1rc604__py3-none-any.whl → 0.10.1rc606__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.1rc604
3
+ Version: 0.10.1rc606
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
@@ -128,7 +128,7 @@ reconcile/aus/ocm_addons_upgrade_scheduler_org.py,sha256=fshslI27hrqT40qrVsVOQaW
128
128
  reconcile/aus/ocm_upgrade_scheduler.py,sha256=7cK2SakCFkl5EdnqUEAYdUo4pUnnf-SsUR10uytAGyE,3058
129
129
  reconcile/aus/ocm_upgrade_scheduler_org.py,sha256=OBgE5mnVdQQV4tMH0AE2V_PDt9Gy6d-LyuPceqjORts,2331
130
130
  reconcile/aus/upgrades.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
131
- reconcile/aus/version_gate_approver.py,sha256=VJ6Lrzkapr14QvulzIsE-sTfawIDcyn9UGOC3pIM1gs,6895
131
+ reconcile/aus/version_gate_approver.py,sha256=sZEVB0qVpAXpqymHxavFprkqmqt29fZAIuzSjPHLLrQ,7239
132
132
  reconcile/aus/version_gates/__init__.py,sha256=fWx-IvS132Wpa4gWNIuoNvFwqhkuUuFWYWq5-xiLklI,362
133
133
  reconcile/aus/version_gates/handler.py,sha256=S_isQPYHbG4DERiUEvQBZ6ngiFX3uMmATA-Q_eNKmFk,839
134
134
  reconcile/aus/version_gates/ocp_gate_handler.py,sha256=RW1ppDaCZXVegV9AzzqYXxDUu_Z_7d43Z5h2Pk_piKc,716
@@ -392,8 +392,8 @@ reconcile/templates/aws_access_key_email.j2,sha256=2MUr1ERmyISzKgHqsWYLd-1Wbl-pe
392
392
  reconcile/templates/email.yml.j2,sha256=OZgczNRgXPj2gVYTgwQyHAQrMGu7xp-e4W1rX19GcrU,690
393
393
  reconcile/templates/jira-checkpoint-missinginfo.j2,sha256=c_Vvg-lEENsB3tgxm9B6Y9igCUQhCnFDYh6xw-zcIbU,570
394
394
  reconcile/templating/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
395
- reconcile/templating/renderer.py,sha256=3wQrVFbm1gdF6Wb1NfCjaXzJ9tTIhFwZO8TlR90eUdc,5086
396
- reconcile/templating/rendering.py,sha256=EWgtnnzjnMFxVkfL7qsvokIvoUhPnJxEr_goy5vgTMo,4526
395
+ reconcile/templating/renderer.py,sha256=IOZN0ASSKqp4JGXZ1BDba4XosD3nCuqhStxHMGBcxDI,5119
396
+ reconcile/templating/rendering.py,sha256=2kMfstQz12FL-Qfh9OBuzAcYY1OggbFQrCYx1nxERSg,4737
397
397
  reconcile/templating/validator.py,sha256=W64nR1eoKVDGewJ4DEX9ZiWWKjFEKg5w5Xi6lrrPBd8,3434
398
398
  reconcile/test/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
399
399
  reconcile/test/conftest.py,sha256=rQousYrxUz-EwAIbsYO6bIwR1B4CrOz9y_zaUVo2lfI,4466
@@ -670,7 +670,7 @@ reconcile/utils/ocm/syncsets.py,sha256=zvji9qWvInIRTdoybMaM9-VUhq4L1VewWfWCQmp4u
670
670
  reconcile/utils/ocm/upgrades.py,sha256=ZWDfg3VrmRGx7Re-JjecRjwmn7Rh-dsuLA3OljbCByg,6616
671
671
  reconcile/utils/rosa/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
672
672
  reconcile/utils/rosa/rosa_cli.py,sha256=zuXBRh-cJK4yOPjtiSRbUQRURemFiLlWdjj3XteuQ-4,10475
673
- reconcile/utils/rosa/session.py,sha256=HNE3od_gUL38q43lpKVvaIatd6LYgRnYzRBFbv5hHgQ,3875
673
+ reconcile/utils/rosa/session.py,sha256=nPEmSNos0_ATQEVg2KckAlVyIEBvxUVo7pa0WMACoOU,4150
674
674
  reconcile/utils/runtime/__init__.py,sha256=sfk92MGfsBh9tKYHl_FH17NdEsrGBwgDFTb7KNKoIfY,107
675
675
  reconcile/utils/runtime/desired_state_diff.py,sha256=finZnWoVDCiYTgu4lGk8G4QOFAGgiIDhD3fcnVqYoxM,8108
676
676
  reconcile/utils/runtime/environment.py,sha256=JLptHJoYyeLdMBghJppttP3wZ5HxHLMLgUcfGjIiKLM,2087
@@ -709,8 +709,8 @@ tools/test/test_app_interface_metrics_exporter.py,sha256=SX7qL3D1SIRKFo95FoQztvf
709
709
  tools/test/test_qontract_cli.py,sha256=OvalpVRfY4pNmpMaWHHYqBjV68b1eGQjX8SCyTAXb1w,3501
710
710
  tools/test/test_sd_app_sre_alert_report.py,sha256=v363r9zM7__0kR5K6mvJoGFcM9BvE33fWAayrqkpojA,2116
711
711
  tools/test/test_sre_checkpoints.py,sha256=SKqPPTl9ua0RFdSSofnoQX-JZE6dFLO3LRhfQzqtfh8,2607
712
- qontract_reconcile-0.10.1rc604.dist-info/METADATA,sha256=8DqZZvzBIt5WiKjrw88w6gjkqWMvmmFJteu3Hskyuyo,2349
713
- qontract_reconcile-0.10.1rc604.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
714
- qontract_reconcile-0.10.1rc604.dist-info/entry_points.txt,sha256=rTjAv28I_CHLM8ID3OPqMI_suoQ9s7tFbim4aYjn9kk,376
715
- qontract_reconcile-0.10.1rc604.dist-info/top_level.txt,sha256=l5ISPoXzt0SdR4jVdkfa7RPSKNc8zAHYWAnR-Dw8Ey8,24
716
- qontract_reconcile-0.10.1rc604.dist-info/RECORD,,
712
+ qontract_reconcile-0.10.1rc606.dist-info/METADATA,sha256=eUhofv8hXCCHrIOqQ_i7gu9ICj-Yd6JG8k3SibY-ZlY,2349
713
+ qontract_reconcile-0.10.1rc606.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
714
+ qontract_reconcile-0.10.1rc606.dist-info/entry_points.txt,sha256=rTjAv28I_CHLM8ID3OPqMI_suoQ9s7tFbim4aYjn9kk,376
715
+ qontract_reconcile-0.10.1rc606.dist-info/top_level.txt,sha256=l5ISPoXzt0SdR4jVdkfa7RPSKNc8zAHYWAnR-Dw8Ey8,24
716
+ qontract_reconcile-0.10.1rc606.dist-info/RECORD,,
@@ -178,6 +178,9 @@ class VersionGateApprover(QontractReconcileIntegration[VersionGateApproverParams
178
178
  for gate in gates:
179
179
  if gate.label in self.handlers and gate.label not in enabled_gate_handlers:
180
180
  continue
181
+ logging.info(
182
+ f"handle gate {gate.label} for cluster {cluster.name} {{gate_id = {gate.id}), version = {gate.version_raw_id_prefix}, cluster_id = {cluster.id}, org_id = {ocm_org_id}}}"
183
+ )
181
184
  success = self.handlers[gate.label].handle(
182
185
  ocm_api=ocm_api,
183
186
  ocm_org_id=ocm_org_id,
@@ -189,7 +192,7 @@ class VersionGateApprover(QontractReconcileIntegration[VersionGateApproverParams
189
192
  create_version_agreement(ocm_api, gate.id, cluster.id)
190
193
  elif not success:
191
194
  logging.error(
192
- f"Failed to handle gate {gate.id} for cluster {cluster.name}"
195
+ f"failed to handle gate {gate.label} for cluster {cluster.name} {{gate_id = {gate.id}), version = {gate.version_raw_id_prefix}, cluster_id = {cluster.id}, org_id = {ocm_org_id}}}"
193
196
  )
194
197
 
195
198
 
@@ -2,7 +2,7 @@ import logging
2
2
  import os
3
3
  from abc import ABC, abstractmethod
4
4
  from collections.abc import Callable
5
- from typing import Optional
5
+ from typing import Any, Optional
6
6
 
7
7
  from pydantic import BaseModel
8
8
  from ruamel import yaml
@@ -87,12 +87,12 @@ def unpack_static_variables(
87
87
 
88
88
  def unpack_dynamic_variables(
89
89
  collection_variables: TemplateCollectionVariablesV1, gql: gql.GqlApi
90
- ) -> dict:
90
+ ) -> dict[str, dict[str, Any]]:
91
91
  if not collection_variables.dynamic:
92
92
  return {}
93
+
93
94
  return {
94
- dv.name: list(gql.query(dv.query).values())
95
- for dv in collection_variables.dynamic or []
95
+ dv.name: gql.query(dv.query) or {} for dv in collection_variables.dynamic or []
96
96
  }
97
97
 
98
98
 
@@ -137,7 +137,9 @@ class TemplateRendererIntegration(QontractReconcileIntegration):
137
137
  output = r.render_output()
138
138
 
139
139
  if current_str != output:
140
- print(f"diff in template {template.name} for target_path {target_path}")
140
+ logging.info(
141
+ f"diff for template {template.name} in target path {target_path}"
142
+ )
141
143
  return TemplateOutput(
142
144
  path=target_path,
143
145
  content=output,
@@ -156,12 +158,11 @@ class TemplateRendererIntegration(QontractReconcileIntegration):
156
158
  ruaml_instance = create_ruamel_instance()
157
159
 
158
160
  for c in get_template_collections():
159
- variables = {}
160
161
  if c.variables:
161
- variables.update(
162
- unpack_dynamic_variables(c.variables, gql_no_validation)
163
- )
164
- variables.update(unpack_static_variables(c.variables))
162
+ variables = {
163
+ "dynamic": unpack_dynamic_variables(c.variables, gql_no_validation),
164
+ "static": unpack_static_variables(c.variables),
165
+ }
165
166
 
166
167
  for template in c.templates:
167
168
  output = self.process_template(
@@ -1,10 +1,11 @@
1
+ import logging
1
2
  from abc import ABC, abstractmethod
2
3
  from typing import Any, Optional, Protocol
3
4
 
4
5
  from pydantic import BaseModel
5
6
  from ruamel import yaml
6
7
 
7
- from reconcile.utils.jinja2.utils import process_jinja2_template
8
+ from reconcile.utils.jinja2.utils import Jinja2TemplateError, process_jinja2_template
8
9
  from reconcile.utils.jsonpath import parse_jsonpath
9
10
  from reconcile.utils.secret_reader import SecretReaderBase
10
11
 
@@ -49,11 +50,15 @@ class Renderer(ABC):
49
50
  return {**self.data.variables, "current": self.data.current}
50
51
 
51
52
  def _render_template(self, template: str) -> str:
52
- return process_jinja2_template(
53
- body=template,
54
- vars=self._jinja2_render_kwargs(),
55
- secret_reader=self.secret_reader,
56
- )
53
+ try:
54
+ return process_jinja2_template(
55
+ body=template,
56
+ vars=self._jinja2_render_kwargs(),
57
+ secret_reader=self.secret_reader,
58
+ )
59
+ except Jinja2TemplateError as e:
60
+ logging.error(f"Error rendering template {self.template.name}: {e}")
61
+ raise e
57
62
 
58
63
  @abstractmethod
59
64
  def render_output(self) -> str:
@@ -89,6 +89,9 @@ class RosaSession:
89
89
  def upgrade_account_roles(
90
90
  self, role_prefix: str, minor_version: str, channel_group: str, dry_run: bool
91
91
  ) -> None:
92
+ logging.info(
93
+ f"Upgrade account roles in AWS account {self.aws_account_id} to {minor_version} ({channel_group})"
94
+ )
92
95
  if not dry_run:
93
96
  result = self.cli_execute(
94
97
  f"rosa upgrade account-roles --prefix {role_prefix} --version {minor_version} --channel-group {channel_group} -y -m=auto"
@@ -104,6 +107,9 @@ class RosaSession:
104
107
  Upgrades the operator roles of a cluster to match the latest
105
108
  policy versions available for the cluster.
106
109
  """
110
+ logging.info(
111
+ f"Upgrade operator roles in AWS account {self.aws_account_id} for cluster {cluster_id}"
112
+ )
107
113
  if not dry_run:
108
114
  result = self.cli_execute(
109
115
  cmd=f"rosa upgrade operator-roles --cluster {cluster_id} -y -m=auto",