qontract-reconcile 0.10.1rc1182__py3-none-any.whl → 0.10.1rc1183__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.1rc1182
3
+ Version: 0.10.1rc1183
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
@@ -726,7 +726,7 @@ reconcile/utils/sqs_gateway.py,sha256=XNIf3PY4UCPNufP2Ul0UJj3fKlt5larBba-VTT-41F
726
726
  reconcile/utils/state.py,sha256=W0_awkLAPX18hNOF_60o73tkPxDUylqbzYNHfl_sDsk,16386
727
727
  reconcile/utils/structs.py,sha256=LcbLEg8WxfRqM6nW7NhcWN0YeqF7SQzxOgntmLs1SgY,352
728
728
  reconcile/utils/template.py,sha256=wTvRU4AnAV_o042tD4Mwls2dwWMuk7MKnde3MaCjaYg,331
729
- reconcile/utils/terraform_client.py,sha256=LjX2U2E0Dglt2S_KA5jWQ_dVC8sPn4FEAh0xW_d6JTk,35953
729
+ reconcile/utils/terraform_client.py,sha256=IQV6JsoGH-Fy987stSJ3_A2f2ys_cIj6s9761krePi4,36035
730
730
  reconcile/utils/terrascript_aws_client.py,sha256=q6Ydbjle7K5Z3LYpoRJGXnb50ix6aGN6jLvP2vglPz8,283769
731
731
  reconcile/utils/three_way_diff_strategy.py,sha256=oQcHXd9LVhirJfoaOBoHUYuZVGfyL2voKr6KVI34zZE,4833
732
732
  reconcile/utils/throughput.py,sha256=iP4UWAe2LVhDo69mPPmgo9nQ7RxHD6_GS8MZe-aSiuM,344
@@ -882,8 +882,8 @@ tools/test/test_qontract_cli.py,sha256=iuzKbQ6ahinvjoQmQLBrG4shey0z-1rB6qCgS8T6d
882
882
  tools/test/test_saas_promotion_state.py,sha256=dy4kkSSAQ7bC0Xp2CociETGN-2aABEfL6FU5D9Jl00Y,6056
883
883
  tools/test/test_sd_app_sre_alert_report.py,sha256=v363r9zM7__0kR5K6mvJoGFcM9BvE33fWAayrqkpojA,2116
884
884
  tools/test/test_sre_checkpoints.py,sha256=SKqPPTl9ua0RFdSSofnoQX-JZE6dFLO3LRhfQzqtfh8,2607
885
- qontract_reconcile-0.10.1rc1182.dist-info/METADATA,sha256=gdReu60z2THXeO2P__JA2nYHErSt6uI8EoVgnxsl5ro,2213
886
- qontract_reconcile-0.10.1rc1182.dist-info/WHEEL,sha256=bFJAMchF8aTQGUgMZzHJyDDMPTO3ToJ7x23SLJa1SVo,92
887
- qontract_reconcile-0.10.1rc1182.dist-info/entry_points.txt,sha256=GKQqCl2j2X1BJQ69een6rHcR26PmnxnONLNOQB-nRjY,491
888
- qontract_reconcile-0.10.1rc1182.dist-info/top_level.txt,sha256=l5ISPoXzt0SdR4jVdkfa7RPSKNc8zAHYWAnR-Dw8Ey8,24
889
- qontract_reconcile-0.10.1rc1182.dist-info/RECORD,,
885
+ qontract_reconcile-0.10.1rc1183.dist-info/METADATA,sha256=awLi7LWrtIKv-9-jSwBD1xyD2dU782uKtYHtKl89r4w,2213
886
+ qontract_reconcile-0.10.1rc1183.dist-info/WHEEL,sha256=bFJAMchF8aTQGUgMZzHJyDDMPTO3ToJ7x23SLJa1SVo,92
887
+ qontract_reconcile-0.10.1rc1183.dist-info/entry_points.txt,sha256=GKQqCl2j2X1BJQ69een6rHcR26PmnxnONLNOQB-nRjY,491
888
+ qontract_reconcile-0.10.1rc1183.dist-info/top_level.txt,sha256=l5ISPoXzt0SdR4jVdkfa7RPSKNc8zAHYWAnR-Dw8Ey8,24
889
+ qontract_reconcile-0.10.1rc1183.dist-info/RECORD,,
@@ -68,6 +68,10 @@ class TerraformCommandError(CalledProcessError):
68
68
  pass
69
69
 
70
70
 
71
+ class RdsUpgradeValidationError(Exception):
72
+ pass
73
+
74
+
71
75
  class DeletionApprovalExpirationValueError(Exception):
72
76
  pass
73
77
 
@@ -218,7 +222,7 @@ class TerraformClient: # pylint: disable=too-many-public-methods
218
222
  if disable_deletions_detected:
219
223
  raise RuntimeError("Terraform plan has disabled deletions detected")
220
224
 
221
- @retry()
225
+ @retry(no_retry_exceptions=RdsUpgradeValidationError)
222
226
  def terraform_plan(
223
227
  self, spec: TerraformSpec, enable_deletion: bool
224
228
  ) -> tuple[bool, list[AccountUser], bool]:
@@ -788,21 +792,19 @@ class TerraformClient: # pylint: disable=too-many-public-methods
788
792
  None,
789
793
  )
790
794
  if target is None:
791
- logging.error(
795
+ raise RdsUpgradeValidationError(
792
796
  f"Cannot upgrade RDS instance: {resource_name} "
793
797
  f"from {before_version} to {after_version}"
794
798
  )
795
- return
796
799
  allow_major_version_upgrade = after.get(
797
800
  "allow_major_version_upgrade",
798
801
  False,
799
802
  )
800
803
  if target["IsMajorVersionUpgrade"] and not allow_major_version_upgrade:
801
- logging.error(
804
+ raise RdsUpgradeValidationError(
802
805
  "allow_major_version_upgrade is not enabled for upgrading RDS instance: "
803
806
  f"{resource_name} to a new major version."
804
807
  )
805
- return
806
808
 
807
809
  blue_green_update = after.get("blue_green_update", [])
808
810
  if blue_green_update and blue_green_update[0]["enabled"]:
@@ -859,36 +861,32 @@ class TerraformClient: # pylint: disable=too-many-public-methods
859
861
  return False
860
862
 
861
863
  if not is_supported(engine, version):
862
- logging.error(
864
+ raise RdsUpgradeValidationError(
863
865
  f"Cannot upgrade RDS instance: {resource_name}. "
864
866
  f"Engine version {version} is not supported for blue/green updates."
865
867
  )
866
- return
867
868
 
868
869
  if replica:
869
- logging.error(
870
+ raise RdsUpgradeValidationError(
870
871
  f"Cannot upgrade RDS instance: {resource_name}. "
871
872
  "Blue/green updates are not supported for instances with read replicas."
872
873
  )
873
- return
874
874
 
875
875
  if engine == "postgres" and self._aws_api is not None:
876
876
  pg_details = self._aws_api.describe_db_parameter_group(
877
877
  account_name, parameter_group, region_name
878
878
  )
879
879
  if pg_details.get("rds.logical_replication") != "1":
880
- logging.error(
880
+ raise RdsUpgradeValidationError(
881
881
  f"Cannot upgrade RDS instance: {resource_name}. "
882
882
  f"Blue/green updates require logical replication to be enabled in the Parameter group {parameter_group}."
883
883
  )
884
- return
885
884
 
886
885
  if "storage_type" in changed_fields or "allocated_storage" in changed_fields:
887
- logging.error(
886
+ raise RdsUpgradeValidationError(
888
887
  f"Cannot upgrade RDS instance: {resource_name}. "
889
888
  f"Blue/green updates are not supported when 'storage_type' or 'allocated_storage' has changed."
890
889
  )
891
- return
892
890
 
893
891
 
894
892
  class TerraformPlanFailed(Exception):