qontract-reconcile 0.10.2.dev95__py3-none-any.whl → 0.10.2.dev97__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.dev95
3
+ Version: 0.10.2.dev97
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
@@ -195,7 +195,7 @@ reconcile/endpoints_discovery/integration.py,sha256=ecjIZK_h6JO2wUhUmJlZ9pjOh60n
195
195
  reconcile/endpoints_discovery/merge_request.py,sha256=_yLb4tnvoZMCko8rta2C_CvOInJa9pa3HzSmHNtjgGU,2978
196
196
  reconcile/endpoints_discovery/merge_request_manager.py,sha256=a8zTIQIpRrUwXexZClwpQnnkEoS6XNZLJziI9x7ly0s,6389
197
197
  reconcile/external_resources/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
198
- reconcile/external_resources/aws.py,sha256=wzN3GHxyqVa4Lqqg5HdogqNW2RM532t0ZiKaQeVGOL4,10968
198
+ reconcile/external_resources/aws.py,sha256=q9ub1vI4meG8YzM6A88Q422XkTu6Y3ja12GuMjCwISs,11631
199
199
  reconcile/external_resources/factories.py,sha256=C0QHT0soEv6z99-ELAAE19S5MaMHhV0t1fSiQn0Coc4,5970
200
200
  reconcile/external_resources/integration.py,sha256=JF38M7R0Z4ADUTx57TZqSZH9k_xpPlbAxQAcGyIISuM,6925
201
201
  reconcile/external_resources/integration_secrets_sync.py,sha256=CImwt_tyS3MMGpkjI_0gZqYt4XgqIw4BtdJiDH2xrCk,1700
@@ -203,12 +203,12 @@ reconcile/external_resources/manager.py,sha256=mvFfcXPzvNqDWDgKTK8eiSe6C_FUvBtbe
203
203
  reconcile/external_resources/meta.py,sha256=noaytFzmShpzLA_ebGh7wuP45mOfHIOnnoUxivjDa1I,672
204
204
  reconcile/external_resources/metrics.py,sha256=KiBjMUaN_z0cSkF_7Ar_a8RiuiwVqjyMcVdISlxhzXE,3898
205
205
  reconcile/external_resources/model.py,sha256=HrSkmAjOqw0aT3CsZKXKMLyocM__8XO5qHb-dXcoagw,13747
206
- reconcile/external_resources/reconciler.py,sha256=-0trp1K-iUgOQn3mm1ZUSmfaReRrUT0eHzPkUhNPolQ,9583
206
+ reconcile/external_resources/reconciler.py,sha256=wB8cB5pmqDJ1_t5_Aly4mrULGnI3OQaKqUZCB_Z9RWw,9573
207
207
  reconcile/external_resources/secrets_sync.py,sha256=ZDxzGZ6wC4zxLhA7-L39xDRH6rzUM285gytuzmRQdlw,16208
208
208
  reconcile/external_resources/state.py,sha256=gF3ACdl7YiUlbQ4uEGrD6i_Txxqr6mT9f8IFlTQ-8dY,13176
209
209
  reconcile/fleet_labeler/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
210
210
  reconcile/fleet_labeler/dependencies.py,sha256=6vD9dC1pXOztWQpQCZa2ZLbXrTf50kzjtpqewRybuJ4,3169
211
- reconcile/fleet_labeler/integration.py,sha256=ZSzU9BRbZ2OZHyvpKnuA0mywzwd0MLRlXRSmwseU6Tk,14071
211
+ reconcile/fleet_labeler/integration.py,sha256=vMvDnQW1NXv2qWeG8ab_gguBq45UtmYErSXy6XR83d8,14149
212
212
  reconcile/fleet_labeler/merge_request.py,sha256=SfGxXInxeJzVnsTtO0ZC9-PesUJMdpKxKY9eCB6ms-g,1538
213
213
  reconcile/fleet_labeler/meta.py,sha256=lWnpH2U0PHCPXu9Ok_CPmO494qQJQ5pOuqo28s0jzIQ,146
214
214
  reconcile/fleet_labeler/metrics.py,sha256=zhcp06woGaZywTqWZf3znh6C2S2u7OHBLXalXYKuTzQ,1934
@@ -224,7 +224,7 @@ reconcile/glitchtip_project_alerts/integration.py,sha256=BgMx-NyV9mTuv7Sotb2OioC
224
224
  reconcile/glitchtip_project_dsn/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
225
225
  reconcile/glitchtip_project_dsn/integration.py,sha256=2iugub-kHYkHNK33n0v9_TeWonuxCPah_VkoTPvaajE,8077
226
226
  reconcile/gql_definitions/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
227
- reconcile/gql_definitions/introspection.json,sha256=nBoWZM_ilrKlbCUF9cbRe7D1jsTqHqfGkLQW2gbleBM,2239254
227
+ reconcile/gql_definitions/introspection.json,sha256=xA_cHhSy0wr9PG9y_Nwk75MbnjtHQjOEMd48nLZMK8E,2239784
228
228
  reconcile/gql_definitions/acs/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
229
229
  reconcile/gql_definitions/acs/acs_instances.py,sha256=L91WW9LbhJbBSrECqShQpFtjoBOsmNIYLRpMbx1io5o,2181
230
230
  reconcile/gql_definitions/acs/acs_policies.py,sha256=bN5i4mks10Z23KJSj7jqp966Osq2dps4d-sPH9gjxEA,7008
@@ -314,7 +314,7 @@ reconcile/gql_definitions/external_resources/external_resources_settings.py,sha2
314
314
  reconcile/gql_definitions/external_resources/fragments/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
315
315
  reconcile/gql_definitions/external_resources/fragments/external_resources_module_overrides.py,sha256=T_qWCRtzU8F9frebBXG9TkeQdrKGt3R9YinSngPoFqM,1262
316
316
  reconcile/gql_definitions/fleet_labeler/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
317
- reconcile/gql_definitions/fleet_labeler/fleet_labels.py,sha256=rII_VzEfjGibY1lJXMBMKdCeV7kaNyRXk9-J9-neBoU,4412
317
+ reconcile/gql_definitions/fleet_labeler/fleet_labels.py,sha256=ow9LTm376Y5rCVMWgRtrj2yWKK7_aBC5AM7svLN7pKo,4546
318
318
  reconcile/gql_definitions/fragments/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
319
319
  reconcile/gql_definitions/fragments/aus_organization.py,sha256=uBKbTuBa3CZmTXR5HOcGhRcu2U9kM93KbYmoWTxcpB0,4767
320
320
  reconcile/gql_definitions/fragments/aws_account_common.py,sha256=3-7ZAP6GSff7Z2Syz2VQCLY4IySqBOSVmceaRiVNQpw,2385
@@ -786,7 +786,7 @@ tools/saas_promotion_state/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJ
786
786
  tools/saas_promotion_state/saas_promotion_state.py,sha256=UfwwRLS5Ya4_Nh1w5n1dvoYtchQvYE9yj1VANt2IKqI,3925
787
787
  tools/sre_checkpoints/__init__.py,sha256=CDaDaywJnmRCLyl_NCcvxi-Zc0hTi_3OdwKiFOyS39I,145
788
788
  tools/sre_checkpoints/util.py,sha256=zEDbGr18ZeHNQwW8pUsr2JRjuXIPz--WAGJxZo9sv_Y,894
789
- qontract_reconcile-0.10.2.dev95.dist-info/METADATA,sha256=FExU6hytglivZHRD19B4ZwbM0V_IKNav1MoR2JBG65M,24565
790
- qontract_reconcile-0.10.2.dev95.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
791
- qontract_reconcile-0.10.2.dev95.dist-info/entry_points.txt,sha256=5i9l54La3vQrDLAdwDKQWC0iG4sV9RRfOb1BpvzOWLc,698
792
- qontract_reconcile-0.10.2.dev95.dist-info/RECORD,,
789
+ qontract_reconcile-0.10.2.dev97.dist-info/METADATA,sha256=KiU0I9ajpxPWox3p0C64xeanHOSJ1CxNhJjgBDfTcrA,24565
790
+ qontract_reconcile-0.10.2.dev97.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
791
+ qontract_reconcile-0.10.2.dev97.dist-info/entry_points.txt,sha256=5i9l54La3vQrDLAdwDKQWC0iG4sV9RRfOb1BpvzOWLc,698
792
+ qontract_reconcile-0.10.2.dev97.dist-info/RECORD,,
@@ -139,6 +139,17 @@ class AWSRdsFactory(AWSDefaultResourceFactory):
139
139
  "aws", provisioner, "kms", identifier
140
140
  )
141
141
 
142
+ def _get_region_from_az(self, az: str) -> str:
143
+ if not az or len(az) < 2:
144
+ raise ValueError(
145
+ f"Invalid availability zone: '{az}'. Availability zone must have at least 2 characters."
146
+ )
147
+ if not az[-1].isalpha():
148
+ raise ValueError(
149
+ f"Invalid availability zone: '{az}'. The AZ should end with a letter (e.g., 'us-east-1a')."
150
+ )
151
+ return az[:-1]
152
+
142
153
  def resolve(
143
154
  self,
144
155
  spec: ExternalResourceSpec,
@@ -168,6 +179,9 @@ class AWSRdsFactory(AWSDefaultResourceFactory):
168
179
  "identifier": sourcedb["identifier"],
169
180
  "region": sourcedb_region,
170
181
  }
182
+ # If AZ is set, but not the region, the region is got from the AZ
183
+ if "availability_zone" in data and "region" not in data:
184
+ data["region"] = self._get_region_from_az(data["availability_zone"])
171
185
 
172
186
  kms_key_id: str = data.get("kms_key_id", None)
173
187
  if kms_key_id and not kms_key_id.startswith("arn:"):
@@ -85,7 +85,7 @@ class ReconciliationK8sJob(K8sJob, BaseModel, frozen=True):
85
85
  return {
86
86
  "provision_provider": self.reconciliation.key.provision_provider,
87
87
  "provisioner": self.reconciliation.key.provisioner_name,
88
- "provider": self.reconciliation.key.provision_provider,
88
+ "provider": self.reconciliation.key.provider,
89
89
  "identifier": self.reconciliation.key.identifier,
90
90
  }
91
91
 
@@ -92,11 +92,12 @@ class FleetLabelerIntegration(QontractReconcileIntegration[NoParams]):
92
92
  metrics=dependencies.metrics,
93
93
  dry_run=dependencies.dry_run,
94
94
  )
95
+ synch_labels = spec.dry_run_label_synchronization or dependencies.dry_run
95
96
  self._sync_subscription_labels(
96
97
  spec=spec,
97
98
  desired_clusters=all_desired_clusters,
98
99
  ocm=ocm,
99
- dry_run=dependencies.dry_run,
100
+ dry_run=synch_labels,
100
101
  )
101
102
 
102
103
  def _discover_desired_clusters(
@@ -33,6 +33,7 @@ query FleetLabelSpecs {
33
33
  name
34
34
  path
35
35
  managedSubscriptionLabelPrefix
36
+ dryRunLabelSynchronization
36
37
  ocm {
37
38
  name
38
39
  environment {
@@ -113,6 +114,7 @@ class FleetLabelsSpecV1(ConfiguredBaseModel):
113
114
  name: str = Field(..., alias="name")
114
115
  path: str = Field(..., alias="path")
115
116
  managed_subscription_label_prefix: str = Field(..., alias="managedSubscriptionLabelPrefix")
117
+ dry_run_label_synchronization: Optional[bool] = Field(..., alias="dryRunLabelSynchronization")
116
118
  ocm: OpenShiftClusterManagerV1 = Field(..., alias="ocm")
117
119
  label_defaults: list[FleetLabelDefaultV1] = Field(..., alias="labelDefaults")
118
120
  clusters: list[FleetClusterV1] = Field(..., alias="clusters")
@@ -34397,6 +34397,18 @@
34397
34397
  "isDeprecated": false,
34398
34398
  "deprecationReason": null
34399
34399
  },
34400
+ {
34401
+ "name": "dryRunLabelSynchronization",
34402
+ "description": null,
34403
+ "args": [],
34404
+ "type": {
34405
+ "kind": "SCALAR",
34406
+ "name": "Boolean",
34407
+ "ofType": null
34408
+ },
34409
+ "isDeprecated": false,
34410
+ "deprecationReason": null
34411
+ },
34400
34412
  {
34401
34413
  "name": "managedSubscriptionLabelPrefix",
34402
34414
  "description": null,