qontract-reconcile 0.10.2.dev73__py3-none-any.whl → 0.10.2.dev74__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.4
2
2
  Name: qontract-reconcile
3
- Version: 0.10.2.dev73
3
+ Version: 0.10.2.dev74
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
@@ -155,7 +155,7 @@ reconcile/aws_saml_idp/integration.py,sha256=Z2JtUx2YIbkn0KVrVa2CoAErPB8vTykOOkW
155
155
  reconcile/aws_saml_roles/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
156
156
  reconcile/aws_saml_roles/integration.py,sha256=inU10Yu0lZpJw_00vVe2bytJrecjLtu2hR7kQQIAbx0,11234
157
157
  reconcile/aws_version_sync/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
158
- reconcile/aws_version_sync/integration.py,sha256=BUVUC90cNVjFPVpGKxGY9b9x-TRVHDElc0kiec_5mDA,17284
158
+ reconcile/aws_version_sync/integration.py,sha256=7tfOZx9uY4bLcPFf0i6o9cu1Hmk9ByoGPTZ66Iv5fYQ,17885
159
159
  reconcile/aws_version_sync/utils.py,sha256=x-45QT7zAwdNvCg7w_qJNwLaksFcfz1_6KQoD_0IVuA,1727
160
160
  reconcile/aws_version_sync/merge_request_manager/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
161
161
  reconcile/aws_version_sync/merge_request_manager/merge_request.py,sha256=2FbqLLdqxycWNvX1eNbwMjWSVBb7q0p-8t5Db0m7b4Q,4842
@@ -777,7 +777,7 @@ tools/saas_promotion_state/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJ
777
777
  tools/saas_promotion_state/saas_promotion_state.py,sha256=UfwwRLS5Ya4_Nh1w5n1dvoYtchQvYE9yj1VANt2IKqI,3925
778
778
  tools/sre_checkpoints/__init__.py,sha256=CDaDaywJnmRCLyl_NCcvxi-Zc0hTi_3OdwKiFOyS39I,145
779
779
  tools/sre_checkpoints/util.py,sha256=zEDbGr18ZeHNQwW8pUsr2JRjuXIPz--WAGJxZo9sv_Y,894
780
- qontract_reconcile-0.10.2.dev73.dist-info/METADATA,sha256=Kw8mFt6cKF4tp764Q0g6r82MRSjY3jGMu7FTlJJr3k4,24565
781
- qontract_reconcile-0.10.2.dev73.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
782
- qontract_reconcile-0.10.2.dev73.dist-info/entry_points.txt,sha256=5i9l54La3vQrDLAdwDKQWC0iG4sV9RRfOb1BpvzOWLc,698
783
- qontract_reconcile-0.10.2.dev73.dist-info/RECORD,,
780
+ qontract_reconcile-0.10.2.dev74.dist-info/METADATA,sha256=TD6ZaK3hyP88I13ucRR7xu-w1np1nDqlv8Q0qRmr_II,24565
781
+ qontract_reconcile-0.10.2.dev74.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
782
+ qontract_reconcile-0.10.2.dev74.dist-info/entry_points.txt,sha256=5i9l54La3vQrDLAdwDKQWC0iG4sV9RRfOb1BpvzOWLc,698
783
+ qontract_reconcile-0.10.2.dev74.dist-info/RECORD,,
@@ -75,11 +75,16 @@ class VersionFormat(StrEnum):
75
75
  MAJOR_MINOR_PATCH = "major_minor_patch"
76
76
 
77
77
 
78
+ class SupportedResourceProvider(StrEnum):
79
+ RDS = "rds"
80
+ ELASTICACHE = "elasticache"
81
+
82
+
78
83
  class ExternalResource(BaseModel):
79
84
  namespace_file: str | None = None
80
85
  provider: str = "aws"
81
86
  provisioner: ExternalResourceProvisioner
82
- resource_provider: str
87
+ resource_provider: SupportedResourceProvider
83
88
  resource_identifier: str
84
89
  resource_engine: str
85
90
  resource_engine_version: semver.VersionInfo
@@ -133,6 +138,15 @@ class ExternalResource(BaseModel):
133
138
  raise ValueError(
134
139
  f"Invalid version format: {resource_engine_version}"
135
140
  )
141
+ if values.get("resource_provider") == SupportedResourceProvider.ELASTICACHE:
142
+ if resource_engine_version.startswith("5"):
143
+ # AWS ElastiCache Redis 5 uses MAJOR_MINOR_PATCH format
144
+ values["resource_engine_version_format"] = (
145
+ VersionFormat.MAJOR_MINOR_PATCH
146
+ )
147
+ else:
148
+ # AWS ElastiCache Redis 6+ uses MAJOR_MINOR format
149
+ values["resource_engine_version_format"] = VersionFormat.MAJOR_MINOR
136
150
  return values
137
151
 
138
152
  @property
@@ -222,7 +236,7 @@ class AVSIntegration(QontractReconcileIntegration[AVSIntegrationParams]):
222
236
  provisioner=ExternalResourceProvisioner(
223
237
  uid=m["aws_account_id"]
224
238
  ),
225
- resource_provider="rds",
239
+ resource_provider=SupportedResourceProvider.RDS,
226
240
  resource_identifier=m["dbinstance_identifier"],
227
241
  resource_engine=m["engine"],
228
242
  resource_engine_version=m["engine_version"],
@@ -241,7 +255,7 @@ class AVSIntegration(QontractReconcileIntegration[AVSIntegrationParams]):
241
255
  provisioner=ExternalResourceProvisioner(
242
256
  uid=m["aws_account_id"]
243
257
  ),
244
- resource_provider="elasticache",
258
+ resource_provider=SupportedResourceProvider.ELASTICACHE,
245
259
  # replication_group_id != resource_identifier!
246
260
  resource_identifier=elasticache_replication_group_id_to_identifier.get(
247
261
  (
@@ -304,11 +318,11 @@ class AVSIntegration(QontractReconcileIntegration[AVSIntegrationParams]):
304
318
  )
305
319
  defaults_cache[resource.defaults] = values
306
320
  values = override_values(values, resource.overrides)
307
- if resource.provider.lower() == "elasticache" and str(
308
- values["engine_version"]
309
- ).lower().endswith("x"):
310
- # see https://gitlab.cee.redhat.com/service/app-interface/-/blob/master/docs/app-sre/sop/upgrade-redis-minor-version.md
311
- # minor version not managed by app-interface anymore. skip it
321
+ if (
322
+ resource.provider == SupportedResourceProvider.ELASTICACHE
323
+ and str(values["engine_version"]).lower().endswith("x")
324
+ ):
325
+ # AWS ElastiCache Redis 6 could use a version like 6.x. Then, we don't need to manage it
312
326
  continue
313
327
 
314
328
  external_resources.append(