qontract-reconcile 0.10.2.dev7__py3-none-any.whl → 0.10.2.dev9__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.dev7
3
+ Version: 0.10.2.dev9
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
@@ -199,9 +199,9 @@ reconcile/external_resources/aws.py,sha256=NSaOeHqFEcMaMxNjJwuQZosolgsJ8XRVvwkEE
199
199
  reconcile/external_resources/factories.py,sha256=TyJMaijDfPIFYks9i6dhKN7nSR1BoCkoBs1iPExKpcE,5493
200
200
  reconcile/external_resources/integration.py,sha256=gBVO5dE8JyZ3xYcYik-MTIp_18oU7_hpYc_oztyfElQ,6753
201
201
  reconcile/external_resources/integration_secrets_sync.py,sha256=dX09O3r6KURziUYYfiki10orNjOGVma-XojhVqd0ww4,1667
202
- reconcile/external_resources/manager.py,sha256=T3z-IEjjr8DpNbnqyzJnnXrdkBksCFcepL6py2U9t-c,15909
202
+ reconcile/external_resources/manager.py,sha256=eVaaGCaKDkc897xt5cA5-B4yYuS9VWR-Z7Uom0uSsG0,15971
203
203
  reconcile/external_resources/meta.py,sha256=noaytFzmShpzLA_ebGh7wuP45mOfHIOnnoUxivjDa1I,672
204
- reconcile/external_resources/metrics.py,sha256=8MZgNtNZzIRSYTX97KEUIUTETZBhitULzWxbShGyMO8,3193
204
+ reconcile/external_resources/metrics.py,sha256=KiBjMUaN_z0cSkF_7Ar_a8RiuiwVqjyMcVdISlxhzXE,3898
205
205
  reconcile/external_resources/model.py,sha256=YJylbAhetN9szpLUFd9jFqxCRMvSWXVxSC9OMQNV-wg,11316
206
206
  reconcile/external_resources/reconciler.py,sha256=K9QvbQCIOCuOHnPIxQE_P_jFtrkF3dGo8d_cCCh08Ys,8973
207
207
  reconcile/external_resources/secrets_sync.py,sha256=H8JfI3JW1XEau1jqv15AhYg49mCZeHwZmqMzMv_6tFc,16344
@@ -215,7 +215,7 @@ reconcile/glitchtip_project_alerts/integration.py,sha256=9faPhmSu5scZ3K3H2IOH31_
215
215
  reconcile/glitchtip_project_dsn/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
216
216
  reconcile/glitchtip_project_dsn/integration.py,sha256=2iugub-kHYkHNK33n0v9_TeWonuxCPah_VkoTPvaajE,8077
217
217
  reconcile/gql_definitions/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
218
- reconcile/gql_definitions/introspection.json,sha256=_tF-lsViLqXOEGKw-asMqRV94XhmFHuaTxqovWq87gw,2215501
218
+ reconcile/gql_definitions/introspection.json,sha256=mlhbQShB7_Xp3xgrT9dzZZaf155i2fkR79gzUsfEGME,2215125
219
219
  reconcile/gql_definitions/acs/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
220
220
  reconcile/gql_definitions/acs/acs_instances.py,sha256=L91WW9LbhJbBSrECqShQpFtjoBOsmNIYLRpMbx1io5o,2181
221
221
  reconcile/gql_definitions/acs/acs_policies.py,sha256=bN5i4mks10Z23KJSj7jqp966Osq2dps4d-sPH9gjxEA,7008
@@ -402,7 +402,7 @@ reconcile/gql_definitions/terraform_cloudflare_users/terraform_cloudflare_roles.
402
402
  reconcile/gql_definitions/terraform_init/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
403
403
  reconcile/gql_definitions/terraform_init/aws_accounts.py,sha256=OJ0hDbRachRaDkL-OGT6-byr9cKdBiQDnNCpwUe3oJ8,2674
404
404
  reconcile/gql_definitions/terraform_repo/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
405
- reconcile/gql_definitions/terraform_repo/terraform_repo.py,sha256=Eb6vb-nBIZMAiIbjTcDTH-eNv3831bvZAIgM6E287Hw,3861
405
+ reconcile/gql_definitions/terraform_repo/terraform_repo.py,sha256=9cDKdP9ziBh9J_mw2Gi6GUOP4mFxMABY_D62qSeMtJI,3881
406
406
  reconcile/gql_definitions/terraform_resources/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
407
407
  reconcile/gql_definitions/terraform_resources/database_access_manager.py,sha256=yv0_YC-LmhaKD_gyGG3le1w5BtypBjlsO894-Zgdg4U,4813
408
408
  reconcile/gql_definitions/terraform_resources/terraform_resources_namespaces.py,sha256=_man82NXH9Jw7OvgDiQCKiLDG6Q7aV_ktOAi12QCXbI,42793
@@ -766,7 +766,7 @@ tools/saas_promotion_state/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJ
766
766
  tools/saas_promotion_state/saas_promotion_state.py,sha256=5LJ9rygZ304vxfsIuRfuxueoYRb72EZNKKITEcJ4Mtk,3908
767
767
  tools/sre_checkpoints/__init__.py,sha256=CDaDaywJnmRCLyl_NCcvxi-Zc0hTi_3OdwKiFOyS39I,145
768
768
  tools/sre_checkpoints/util.py,sha256=zEDbGr18ZeHNQwW8pUsr2JRjuXIPz--WAGJxZo9sv_Y,894
769
- qontract_reconcile-0.10.2.dev7.dist-info/METADATA,sha256=45V1tMRWAHSh5LIcjmF_QZwjk7uVQDqW-Zdz-JcVSNE,24664
770
- qontract_reconcile-0.10.2.dev7.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
771
- qontract_reconcile-0.10.2.dev7.dist-info/entry_points.txt,sha256=JniHZPadNOILPyfSl0LF2YSp3Db7K2_W2CN7i9f3Gos,540
772
- qontract_reconcile-0.10.2.dev7.dist-info/RECORD,,
769
+ qontract_reconcile-0.10.2.dev9.dist-info/METADATA,sha256=1MM4KkLpjovN9OOxuZulyRAZnK74R2qYDrwLmZkdXpw,24664
770
+ qontract_reconcile-0.10.2.dev9.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
771
+ qontract_reconcile-0.10.2.dev9.dist-info/entry_points.txt,sha256=JniHZPadNOILPyfSl0LF2YSp3Db7K2_W2CN7i9f3Gos,540
772
+ qontract_reconcile-0.10.2.dev9.dist-info/RECORD,,
@@ -357,12 +357,14 @@ class ExternalResourcesManager:
357
357
  if reconciliation_status.resource_status.needs_secret_sync:
358
358
  to_sync_keys.add(r.key)
359
359
 
360
- if self._resource_needs_reconciliation(reconciliation=r, state=state):
360
+ if is_reconciled := self._resource_needs_reconciliation(
361
+ reconciliation=r, state=state
362
+ ):
361
363
  self.reconciler.reconcile_resource(reconciliation=r)
362
364
  self._set_resource_reconciliation_in_progress(r, state)
363
365
 
364
366
  if spec := self.er_inventory.get(r.key):
365
- publish_metrics(r, spec, reconciliation_status)
367
+ publish_metrics(r, spec, reconciliation_status, is_reconciled)
366
368
 
367
369
  pending_sync_keys = self.state_mgr.get_keys_by_status(
368
370
  ResourceStatus.PENDING_SECRET_SYNC
@@ -23,6 +23,14 @@ class ExternalResourcesBaseMetric(BaseModel):
23
23
  job_name: str
24
24
 
25
25
 
26
+ class ExternalResourcesReconciliationsCounter(
27
+ ExternalResourcesBaseMetric, CounterMetric
28
+ ):
29
+ @classmethod
30
+ def name(cls) -> str:
31
+ return "external_resources_reconciliations"
32
+
33
+
26
34
  class ExternalResourcesReconcileErrorsCounter(
27
35
  ExternalResourcesBaseMetric, CounterMetric
28
36
  ):
@@ -49,6 +57,7 @@ def publish_metrics(
49
57
  r: Reconciliation,
50
58
  spec: ExternalResourceSpec,
51
59
  reconciliation_status: ReconciliationStatus,
60
+ is_reconciled: bool,
52
61
  ) -> None:
53
62
  job_name = ReconciliationK8sJob(reconciliation=r).name()
54
63
 
@@ -93,3 +102,16 @@ def publish_metrics(
93
102
  job_name=job_name,
94
103
  )
95
104
  )
105
+
106
+ if is_reconciled:
107
+ metrics.inc_counter(
108
+ ExternalResourcesReconciliationsCounter(
109
+ app=spec.namespace["app"]["name"],
110
+ environment=spec.namespace["environment"]["name"],
111
+ provision_provider=r.key.provision_provider,
112
+ provisioner_name=r.key.provisioner_name,
113
+ provider=r.key.provider,
114
+ identifier=r.key.identifier,
115
+ job_name=job_name,
116
+ )
117
+ )
@@ -32452,13 +32452,9 @@
32452
32452
  "description": null,
32453
32453
  "args": [],
32454
32454
  "type": {
32455
- "kind": "NON_NULL",
32456
- "name": null,
32457
- "ofType": {
32458
- "kind": "OBJECT",
32459
- "name": "VaultSecret_v1",
32460
- "ofType": null
32461
- }
32455
+ "kind": "OBJECT",
32456
+ "name": "VaultSecret_v1",
32457
+ "ofType": null
32462
32458
  },
32463
32459
  "isDeprecated": false,
32464
32460
  "deprecationReason": null
@@ -32468,13 +32464,9 @@
32468
32464
  "description": null,
32469
32465
  "args": [],
32470
32466
  "type": {
32471
- "kind": "NON_NULL",
32472
- "name": null,
32473
- "ofType": {
32474
- "kind": "OBJECT",
32475
- "name": "VaultSecret_v1",
32476
- "ofType": null
32477
- }
32467
+ "kind": "OBJECT",
32468
+ "name": "VaultSecret_v1",
32469
+ "ofType": null
32478
32470
  },
32479
32471
  "isDeprecated": false,
32480
32472
  "deprecationReason": null
@@ -100,8 +100,8 @@ class AppV1(ConfiguredBaseModel):
100
100
 
101
101
 
102
102
  class TerraformRepoVariablesV1(ConfiguredBaseModel):
103
- inputs: VaultSecret = Field(..., alias="inputs")
104
- outputs: VaultSecret = Field(..., alias="outputs")
103
+ inputs: Optional[VaultSecret] = Field(..., alias="inputs")
104
+ outputs: Optional[VaultSecret] = Field(..., alias="outputs")
105
105
 
106
106
 
107
107
  class TerraformRepoV1(ConfiguredBaseModel):