qontract-reconcile 0.10.1rc991__py3-none-any.whl → 0.10.1rc992__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.1rc991
3
+ Version: 0.10.1rc992
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
@@ -112,7 +112,7 @@ reconcile/terraform_aws_route53.py,sha256=1C1_xd_xjysPLSYKvohS6bfSsjSMP0U3sWVcRN
112
112
  reconcile/terraform_cloudflare_dns.py,sha256=-aLEe2QnH5cJPu7HWqs-R9NmQ1NlFbcVUm0v7alVL3I,13431
113
113
  reconcile/terraform_cloudflare_resources.py,sha256=41Mj1WkuS75slCDpmhG2GGf1nh3BwfxcdNC73-PNadc,15000
114
114
  reconcile/terraform_cloudflare_users.py,sha256=iyTG5sj20Jg4J4qWJ144KVptfIHGOSfH8wQKxu0imq0,13942
115
- reconcile/terraform_repo.py,sha256=GN_wQytiXqL7SbSKpwm2TLtoLPOkN6atHsS1uynzN28,16269
115
+ reconcile/terraform_repo.py,sha256=E-tVE62H5-B8CStVOi_DwqQ5l3qIYGd-l8MBFSo41mQ,16414
116
116
  reconcile/terraform_resources.py,sha256=-sgMMHDtNvnQyNR05-MKebI_pSiyxSWAg8LmeA2_Ntk,19326
117
117
  reconcile/terraform_tgw_attachments.py,sha256=EucuF4p3RWKTS4GTPd8oZmR79GpIW_grQl2PAeeNQeI,18665
118
118
  reconcile/terraform_users.py,sha256=HqSm3ev3b8dZ9J6F_phDZB-FQsnlsdeKp9RPoY1cU94,10188
@@ -339,6 +339,7 @@ reconcile/gql_definitions/ocm_labels/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeu
339
339
  reconcile/gql_definitions/ocm_labels/clusters.py,sha256=K0DaTnOEdCZAziDbmq3Ktrxzzmzy6sdb3-9kIDk6yao,2932
340
340
  reconcile/gql_definitions/ocm_labels/organizations.py,sha256=ylNna62pG3XidrLQtMwu0LIOsKh6qyC2QImCbur2tV4,2252
341
341
  reconcile/gql_definitions/ocm_oidc_idp/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
342
+ reconcile/gql_definitions/ocm_subscription_labels/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
342
343
  reconcile/gql_definitions/openshift_cluster_bots/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
343
344
  reconcile/gql_definitions/openshift_cluster_bots/clusters.py,sha256=QshhCQeFRu_o0DLpD-4ltT5X_xZHjsCLc5jB3an3UXs,3688
344
345
  reconcile/gql_definitions/openshift_groups/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -384,7 +385,7 @@ reconcile/gql_definitions/terraform_cloudflare_users/terraform_cloudflare_roles.
384
385
  reconcile/gql_definitions/terraform_init/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
385
386
  reconcile/gql_definitions/terraform_init/aws_accounts.py,sha256=OJ0hDbRachRaDkL-OGT6-byr9cKdBiQDnNCpwUe3oJ8,2674
386
387
  reconcile/gql_definitions/terraform_repo/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
387
- reconcile/gql_definitions/terraform_repo/terraform_repo.py,sha256=_rdq3efy5Q3QFpI-vcs3-wacsXo_1fu1kVix_E83h5Q,3599
388
+ reconcile/gql_definitions/terraform_repo/terraform_repo.py,sha256=nm4CH7Vog4aabdvCKmhVSUvoUb7dxSLx8nwAEJAVqG0,3706
388
389
  reconcile/gql_definitions/terraform_resources/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
389
390
  reconcile/gql_definitions/terraform_resources/database_access_manager.py,sha256=yv0_YC-LmhaKD_gyGG3le1w5BtypBjlsO894-Zgdg4U,4813
390
391
  reconcile/gql_definitions/terraform_resources/terraform_resources_namespaces.py,sha256=1PQBvcJjErRaG529kAzMwfw-ShNaM92IQovlwEiYrV8,42491
@@ -553,7 +554,7 @@ reconcile/test/test_terraform_aws_route53.py,sha256=xHggb8K1P76OyCfFcogbkmyKle-N
553
554
  reconcile/test/test_terraform_cloudflare_dns.py,sha256=aQTXX8Vr4h9aWvJZTnpZEhMGYoBpT2d45ZxU_ECIQ6o,3425
554
555
  reconcile/test/test_terraform_cloudflare_resources.py,sha256=1mdSZS-38mtTSg7teJgDCJU1b_yKbwnrr3N5m8kwV4k,13595
555
556
  reconcile/test/test_terraform_cloudflare_users.py,sha256=2VGBtMUhckLPtUnQlHIzpGsCnyVJZPNLFf-ABELkxbQ,27456
556
- reconcile/test/test_terraform_repo.py,sha256=j9mLfwiK707U2KRxYpvzAbOYywk__pL9SXAH3xbP1t8,12184
557
+ reconcile/test/test_terraform_repo.py,sha256=INfl-VlUtpV87J0neQt4wliptnX7PKvxLPF-ZgweTFA,12960
557
558
  reconcile/test/test_terraform_resources.py,sha256=8C97yXIEihaQ3DZrtjxLNt4y4G12IOhD01ydm7JjliY,15359
558
559
  reconcile/test/test_terraform_tgw_attachments.py,sha256=SM6QwogMZNLh0BkUyaxzFafuOLp23-hBtYTu_F53C4I,40922
559
560
  reconcile/test/test_terraform_users.py,sha256=XOAfGvITCJPI1LTlISmHbA4ONMQMkxYUMTsny7pQCFw,4319
@@ -853,8 +854,8 @@ tools/test/test_qontract_cli.py,sha256=_D61RFGAN5x44CY1tYbouhlGXXABwYfxKSWSQx3Jr
853
854
  tools/test/test_saas_promotion_state.py,sha256=dy4kkSSAQ7bC0Xp2CociETGN-2aABEfL6FU5D9Jl00Y,6056
854
855
  tools/test/test_sd_app_sre_alert_report.py,sha256=v363r9zM7__0kR5K6mvJoGFcM9BvE33fWAayrqkpojA,2116
855
856
  tools/test/test_sre_checkpoints.py,sha256=SKqPPTl9ua0RFdSSofnoQX-JZE6dFLO3LRhfQzqtfh8,2607
856
- qontract_reconcile-0.10.1rc991.dist-info/METADATA,sha256=LT6qfb0l7vFc3yL6lrb_VBUmi57gqCi4gBdxOsZ18u0,2262
857
- qontract_reconcile-0.10.1rc991.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
858
- qontract_reconcile-0.10.1rc991.dist-info/entry_points.txt,sha256=GKQqCl2j2X1BJQ69een6rHcR26PmnxnONLNOQB-nRjY,491
859
- qontract_reconcile-0.10.1rc991.dist-info/top_level.txt,sha256=l5ISPoXzt0SdR4jVdkfa7RPSKNc8zAHYWAnR-Dw8Ey8,24
860
- qontract_reconcile-0.10.1rc991.dist-info/RECORD,,
857
+ qontract_reconcile-0.10.1rc992.dist-info/METADATA,sha256=DRFJMM8ZzS7zsrDv77wTXC9PngnJiNg-SphE3U7qjrQ,2262
858
+ qontract_reconcile-0.10.1rc992.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
859
+ qontract_reconcile-0.10.1rc992.dist-info/entry_points.txt,sha256=GKQqCl2j2X1BJQ69een6rHcR26PmnxnONLNOQB-nRjY,491
860
+ qontract_reconcile-0.10.1rc992.dist-info/top_level.txt,sha256=l5ISPoXzt0SdR4jVdkfa7RPSKNc8zAHYWAnR-Dw8Ey8,24
861
+ qontract_reconcile-0.10.1rc992.dist-info/RECORD,,
@@ -53,6 +53,7 @@ query TerraformRepo {
53
53
  delete
54
54
  requireFips
55
55
  tfVersion
56
+ forceRerunTimestamp
56
57
  variables {
57
58
  inputs {
58
59
  ...VaultSecret
@@ -105,6 +106,7 @@ class TerraformRepoV1(ConfiguredBaseModel):
105
106
  delete: Optional[bool] = Field(..., alias="delete")
106
107
  require_fips: Optional[bool] = Field(..., alias="requireFips")
107
108
  tf_version: str = Field(..., alias="tfVersion")
109
+ force_rerun_timestamp: Optional[str] = Field(..., alias="forceRerunTimestamp")
108
110
  variables: Optional[TerraformRepoVariablesV1] = Field(..., alias="variables")
109
111
 
110
112
 
@@ -361,6 +361,8 @@ class TerraformRepoIntegration(
361
361
  )
362
362
  if self.params.validate_git:
363
363
  self.check_ref(d.repository, d.ref)
364
+ if c.force_rerun_timestamp != d.force_rerun_timestamp:
365
+ logging.info("user has forced a re-run of tf-repo execution")
364
366
 
365
367
  if len(merged) != 0:
366
368
  if not dry_run and state:
@@ -1,3 +1,4 @@
1
+ from datetime import datetime
1
2
  from unittest.mock import MagicMock
2
3
 
3
4
  import pytest
@@ -46,6 +47,7 @@ def existing_repo(aws_account, tf_variables) -> TerraformRepoV1:
46
47
  requireFips=True,
47
48
  tfVersion=A_REPO_VERSION,
48
49
  variables=tf_variables,
50
+ forceRerunTimestamp=None,
49
51
  )
50
52
 
51
53
 
@@ -86,6 +88,7 @@ def new_repo(aws_account_no_state) -> TerraformRepoV1:
86
88
  requireFips=False,
87
89
  tfVersion=B_REPO_VERSION,
88
90
  variables=None,
91
+ forceRerunTimestamp=None,
89
92
  )
90
93
 
91
94
 
@@ -220,6 +223,27 @@ def test_updating_repo_ref(existing_repo, int_params, state_mock):
220
223
  )
221
224
 
222
225
 
226
+ def test_force_rerun(existing_repo, int_params, state_mock):
227
+ existing = [existing_repo]
228
+ updated_repo = TerraformRepoV1.copy(existing_repo)
229
+ updated_repo.force_rerun_timestamp = datetime.now().isoformat()
230
+
231
+ integration = TerraformRepoIntegration(params=int_params)
232
+ diff = integration.calculate_diff(
233
+ existing_state=existing,
234
+ desired_state=[updated_repo],
235
+ dry_run=False,
236
+ state=state_mock,
237
+ recreate_state=False,
238
+ )
239
+
240
+ assert diff == [updated_repo]
241
+
242
+ state_mock.add.assert_called_once_with(
243
+ updated_repo.name, updated_repo.dict(by_alias=True), force=True
244
+ )
245
+
246
+
223
247
  def test_fail_on_update_invalid_repo_params(existing_repo, int_params):
224
248
  existing = [existing_repo]
225
249
  updated_repo = TerraformRepoV1.copy(existing_repo)
@@ -291,6 +315,7 @@ def test_get_repo_state(s3_state_builder, int_params, existing_repo, tf_variable
291
315
  "requireFips": True,
292
316
  "tfVersion": A_REPO_VERSION,
293
317
  "variables": tf_variables,
318
+ "forceRerunTimestamp": None,
294
319
  "account": {
295
320
  "name": "foo",
296
321
  "uid": AWS_UID,