qontract-reconcile 0.9.1rc293__py3-none-any.whl → 0.9.1rc295__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.9.1rc293
3
+ Version: 0.9.1rc295
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
@@ -119,7 +119,7 @@ reconcile/sql_query.py,sha256=AtJQseNBzigiY3Ii4Je0DDBDj8sxzsCTaxLyIaXkPcU,22432
119
119
  reconcile/status.py,sha256=tRYtzPFsGETOfN57rcsLIJRl7cZVFkfQXNsUtoeJ7ns,545
120
120
  reconcile/template_tester.py,sha256=vZz8GM46waQUGd3OVnhW5OLTqctFMH_Hh1QXxT5hduM,2384
121
121
  reconcile/terraform_aws_route53.py,sha256=06VIlIb95BzVkxV_1TPiaY9sQO-TkvQXL4V_qzuXxxA,9814
122
- reconcile/terraform_cloudflare_dns.py,sha256=cCwDaFZ9KGNsCjVnz89LMWi5V8mhkbAvQE40g30YVqU,14647
122
+ reconcile/terraform_cloudflare_dns.py,sha256=Jc8YLLc6sxov8U3onTQsFcoK5IuQW0Jn4--4ZN7HRAA,14552
123
123
  reconcile/terraform_cloudflare_resources.py,sha256=BQg12mHm1iaxf086FFPZutPbWKUMaddqu-nREPR8ptA,14887
124
124
  reconcile/terraform_cloudflare_users.py,sha256=lTbrxi8OtW9Pfcr7Yp-70ihldMQKx9dJ7ZgbGHey1XE,13627
125
125
  reconcile/terraform_resources.py,sha256=gQ-LT0TGwf9OR4RF5EWDmNHUnKWnbhrIMtyIdUgP4D4,16782
@@ -179,6 +179,7 @@ reconcile/gql_definitions/common/app_interface_state_settings.py,sha256=-u159W10
179
179
  reconcile/gql_definitions/common/app_interface_vault_settings.py,sha256=GEjbO_R9qSWy-tyLoSR8P1usQ3QPA8kxIofd507xJzs,1789
180
180
  reconcile/gql_definitions/common/clusters.py,sha256=qr8gnFH71pYUGijReg0NvaQ7LF8u3pRvp1wG_8a43ig,24303
181
181
  reconcile/gql_definitions/common/clusters_minimal.py,sha256=iYnAPQ7jDtEu06XgkDlltXa2_iJsp56rIfDqEYef-uM,5257
182
+ reconcile/gql_definitions/common/clusters_with_peering.py,sha256=HiAjIcKt9ojihIFXZmYX9ELZDqgpGIWPhmUpoiEEMZY,11985
182
183
  reconcile/gql_definitions/common/github_orgs.py,sha256=G73Oa0oMLpqhaxw23HA_fxoyO2VJOEJh4WSAAz3NF2Y,2043
183
184
  reconcile/gql_definitions/common/namespaces.py,sha256=HNu55aeBQUGr4JfjQFj8sGAE2SILh_TtTT6LmsHfwPo,9161
184
185
  reconcile/gql_definitions/common/namespaces_minimal.py,sha256=0n9f2ldd_aEN9tzcqKvtzZ53ceH-1v411vVkD8wPaeY,3539
@@ -434,6 +435,7 @@ reconcile/typed_queries/app_interface_state_settings.py,sha256=ytNAf3feg8JwmdCC4
434
435
  reconcile/typed_queries/app_interface_vault_settings.py,sha256=uFS7qLjjGnrK8gm2fkUT8RFd7s_5kxTWWpxZRhr1Ndo,746
435
436
  reconcile/typed_queries/clusters.py,sha256=mjEudUxMl0pqT0CIbDhgRONLQqfhTvDPS4SVyl0zIpM,393
436
437
  reconcile/typed_queries/clusters_minimal.py,sha256=MwFj2F_rqBFDI3sPbR4QbiME6HIYEPhrOyy07i_-oA8,409
438
+ reconcile/typed_queries/clusters_with_peering.py,sha256=lIai7SJJD0bqIJbe7virgrbYRqjLouSL2OpJD0itpAY,330
437
439
  reconcile/typed_queries/github_orgs.py,sha256=UZhoPl8qvA_tcO7CZlN8GuMKckt3ywd47Suu61rgHsc,258
438
440
  reconcile/typed_queries/gitlab_instances.py,sha256=ZVQHy2W9xIp53f5qYkjKLHLHgOVtQpxTfcmM1C2046g,291
439
441
  reconcile/typed_queries/glitchtip_settings.py,sha256=Hwq8H73PTK-ZIysGEqWcPEqYyRjETS91h9odp-T5ce0,721
@@ -470,7 +472,7 @@ reconcile/utils/git_secrets.py,sha256=897nRs7tycA3m7YYeVEbzOhI8RFrI9IJT2E0di1eJh
470
472
  reconcile/utils/github_api.py,sha256=6gdlKK0W3vZpxbbtOcohRgvZ4YkiSki7Gxdb16goHPo,2316
471
473
  reconcile/utils/gitlab_api.py,sha256=Pl92DmudBEf6qRvfBs3T3x2psvrUxOPU5beupzW1ug8,24873
472
474
  reconcile/utils/gpg.py,sha256=EKG7_fdMv8BMlV5yUdPiqoTx-KrzmVSEAl2sLkaKwWI,1123
473
- reconcile/utils/gql.py,sha256=gs0prtFY_Jm_-o4Fobz4hmulW9NL6KYkcrCuyXIIn1s,11622
475
+ reconcile/utils/gql.py,sha256=HcD8vYyX1reV1-7kNzszq6bWPJs7CvbNhPvBYwSE0pE,11655
474
476
  reconcile/utils/helm.py,sha256=IWlB_LrBK6ydwNQuZP2aMJGrtQw0lW7qdFqSrd3r8lg,1321
475
477
  reconcile/utils/helpers.py,sha256=rC6QwVBH40hLz6JrlNBB_UZfApaCrwgdjwlOFE_fG2M,371
476
478
  reconcile/utils/imap_client.py,sha256=byFAJATbITJPsGECSbvXBOcCnoeTUpDFiEjzOAxLm_U,1975
@@ -575,8 +577,8 @@ tools/sre_checkpoints/util.py,sha256=zEDbGr18ZeHNQwW8pUsr2JRjuXIPz--WAGJxZo9sv_Y
575
577
  tools/test/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
576
578
  tools/test/test_qontract_cli.py,sha256=awwTHEc2DWlykuqGIYM0WOBoSL0KRnOraCLk3C7izis,1401
577
579
  tools/test/test_sre_checkpoints.py,sha256=SKqPPTl9ua0RFdSSofnoQX-JZE6dFLO3LRhfQzqtfh8,2607
578
- qontract_reconcile-0.9.1rc293.dist-info/METADATA,sha256=W5qa0numv_7mmilROHZXxq1VOZXuPff2nS1CRi-ky-E,2287
579
- qontract_reconcile-0.9.1rc293.dist-info/WHEEL,sha256=pkctZYzUS4AYVn6dJ-7367OJZivF2e8RA9b_ZBjif18,92
580
- qontract_reconcile-0.9.1rc293.dist-info/entry_points.txt,sha256=aIVvB7OTCxYu0QkONzBPfFEyg68Pr8KUVKEEm4ChDVc,333
581
- qontract_reconcile-0.9.1rc293.dist-info/top_level.txt,sha256=j0CHPIc8TsVRB50wOz_jhxjjaRyCJB3NOQeXhuHS67c,34
582
- qontract_reconcile-0.9.1rc293.dist-info/RECORD,,
580
+ qontract_reconcile-0.9.1rc295.dist-info/METADATA,sha256=zGQCGGR7VxEsSnbuXRTqh4OJADAAWItIlIXoYMsPhg0,2287
581
+ qontract_reconcile-0.9.1rc295.dist-info/WHEEL,sha256=pkctZYzUS4AYVn6dJ-7367OJZivF2e8RA9b_ZBjif18,92
582
+ qontract_reconcile-0.9.1rc295.dist-info/entry_points.txt,sha256=aIVvB7OTCxYu0QkONzBPfFEyg68Pr8KUVKEEm4ChDVc,333
583
+ qontract_reconcile-0.9.1rc295.dist-info/top_level.txt,sha256=j0CHPIc8TsVRB50wOz_jhxjjaRyCJB3NOQeXhuHS67c,34
584
+ qontract_reconcile-0.9.1rc295.dist-info/RECORD,,
@@ -0,0 +1,393 @@
1
+ """
2
+ Generated by qenerate plugin=pydantic_v1. DO NOT MODIFY MANUALLY!
3
+ """
4
+ from collections.abc import Callable # noqa: F401 # pylint: disable=W0611
5
+ from datetime import datetime # noqa: F401 # pylint: disable=W0611
6
+ from enum import Enum # noqa: F401 # pylint: disable=W0611
7
+ from typing import ( # noqa: F401 # pylint: disable=W0611
8
+ Any,
9
+ Optional,
10
+ Union,
11
+ )
12
+
13
+ from pydantic import ( # noqa: F401 # pylint: disable=W0611
14
+ BaseModel,
15
+ Extra,
16
+ Field,
17
+ Json,
18
+ )
19
+
20
+ from reconcile.gql_definitions.fragments.aws_infra_management_account import (
21
+ AWSInfrastructureManagementAccount,
22
+ )
23
+ from reconcile.gql_definitions.fragments.ocm_environment import OCMEnvironment
24
+ from reconcile.gql_definitions.fragments.vault_secret import VaultSecret
25
+
26
+
27
+ DEFINITION = """
28
+ fragment AWSInfrastructureManagementAccount on AWSInfrastructureManagementAccount_v1 {
29
+ account {
30
+ name
31
+ uid
32
+ terraformUsername
33
+ resourcesDefaultRegion
34
+ automationToken {
35
+ ... VaultSecret
36
+ }
37
+ }
38
+ accessLevel
39
+ default
40
+ }
41
+
42
+ fragment OCMEnvironment on OpenShiftClusterManagerEnvironment_v1 {
43
+ name
44
+ url
45
+ accessTokenClientId
46
+ accessTokenUrl
47
+ accessTokenClientSecret {
48
+ ... VaultSecret
49
+ }
50
+ }
51
+
52
+ fragment VaultSecret on VaultSecret_v1 {
53
+ path
54
+ field
55
+ version
56
+ format
57
+ }
58
+
59
+ query ClustersWithPeering {
60
+ clusters: clusters_v1
61
+ {
62
+ path
63
+ name
64
+ ocm {
65
+ name
66
+ environment {
67
+ ... OCMEnvironment
68
+ }
69
+ orgId
70
+ accessTokenClientId
71
+ accessTokenUrl
72
+ accessTokenClientSecret {
73
+ ... VaultSecret
74
+ }
75
+ blockedVersions
76
+ }
77
+ awsInfrastructureManagementAccounts {
78
+ ... AWSInfrastructureManagementAccount
79
+ }
80
+
81
+ spec {
82
+ region
83
+ }
84
+ network {
85
+ vpc
86
+ }
87
+ peering {
88
+ connections {
89
+ name
90
+ provider
91
+ manageRoutes
92
+ delete
93
+ ... on ClusterPeeringConnectionAccount_v1 {
94
+ vpc {
95
+ account {
96
+ name
97
+ uid
98
+ terraformUsername
99
+ automationToken {
100
+ ... VaultSecret
101
+ }
102
+ }
103
+ vpc_id
104
+ cidr_block
105
+ region
106
+ }
107
+ assumeRole
108
+ manageAccountRoutes
109
+ }
110
+ ... on ClusterPeeringConnectionAccountVPCMesh_v1 {
111
+ account {
112
+ name
113
+ uid
114
+ terraformUsername
115
+ automationToken {
116
+ ... VaultSecret
117
+ }
118
+ }
119
+ tags
120
+ }
121
+ ... on ClusterPeeringConnectionAccountTGW_v1 {
122
+ account {
123
+ name
124
+ uid
125
+ terraformUsername
126
+ automationToken {
127
+ ... VaultSecret
128
+ }
129
+ }
130
+ tags
131
+ cidrBlock
132
+ manageSecurityGroups
133
+ manageRoute53Associations
134
+ assumeRole
135
+ }
136
+ ... on ClusterPeeringConnectionClusterRequester_v1 {
137
+ cluster {
138
+ name
139
+ network {
140
+ vpc
141
+ }
142
+ spec {
143
+ region
144
+ }
145
+ awsInfrastructureManagementAccounts {
146
+ ... AWSInfrastructureManagementAccount
147
+ }
148
+ peering {
149
+ connections {
150
+ name
151
+ provider
152
+ manageRoutes
153
+ ... on ClusterPeeringConnectionClusterAccepter_v1 {
154
+ name
155
+ cluster {
156
+ name
157
+ }
158
+ awsInfrastructureManagementAccount {
159
+ name
160
+ uid
161
+ terraformUsername
162
+ automationToken {
163
+ ... VaultSecret
164
+ }
165
+ }
166
+ }
167
+ }
168
+ }
169
+ }
170
+ }
171
+ }
172
+ }
173
+ disable {
174
+ integrations
175
+ }
176
+ }
177
+ }
178
+ """
179
+
180
+
181
+ class ConfiguredBaseModel(BaseModel):
182
+ class Config:
183
+ smart_union = True
184
+ extra = Extra.forbid
185
+
186
+
187
+ class OpenShiftClusterManagerV1(ConfiguredBaseModel):
188
+ name: str = Field(..., alias="name")
189
+ environment: OCMEnvironment = Field(..., alias="environment")
190
+ org_id: str = Field(..., alias="orgId")
191
+ access_token_client_id: Optional[str] = Field(..., alias="accessTokenClientId")
192
+ access_token_url: Optional[str] = Field(..., alias="accessTokenUrl")
193
+ access_token_client_secret: Optional[VaultSecret] = Field(
194
+ ..., alias="accessTokenClientSecret"
195
+ )
196
+ blocked_versions: Optional[list[str]] = Field(..., alias="blockedVersions")
197
+
198
+
199
+ class ClusterSpecV1(ConfiguredBaseModel):
200
+ region: str = Field(..., alias="region")
201
+
202
+
203
+ class ClusterNetworkV1(ConfiguredBaseModel):
204
+ vpc: str = Field(..., alias="vpc")
205
+
206
+
207
+ class ClusterPeeringConnectionV1(ConfiguredBaseModel):
208
+ name: str = Field(..., alias="name")
209
+ provider: str = Field(..., alias="provider")
210
+ manage_routes: Optional[bool] = Field(..., alias="manageRoutes")
211
+ delete: Optional[bool] = Field(..., alias="delete")
212
+
213
+
214
+ class AWSAccountV1(ConfiguredBaseModel):
215
+ name: str = Field(..., alias="name")
216
+ uid: str = Field(..., alias="uid")
217
+ terraform_username: Optional[str] = Field(..., alias="terraformUsername")
218
+ automation_token: VaultSecret = Field(..., alias="automationToken")
219
+
220
+
221
+ class AWSVPCV1(ConfiguredBaseModel):
222
+ account: AWSAccountV1 = Field(..., alias="account")
223
+ vpc_id: str = Field(..., alias="vpc_id")
224
+ cidr_block: str = Field(..., alias="cidr_block")
225
+ region: str = Field(..., alias="region")
226
+
227
+
228
+ class ClusterPeeringConnectionAccountV1(ClusterPeeringConnectionV1):
229
+ vpc: AWSVPCV1 = Field(..., alias="vpc")
230
+ assume_role: Optional[str] = Field(..., alias="assumeRole")
231
+ manage_account_routes: Optional[bool] = Field(..., alias="manageAccountRoutes")
232
+
233
+
234
+ class ClusterPeeringConnectionAccountVPCMeshV1_AWSAccountV1(ConfiguredBaseModel):
235
+ name: str = Field(..., alias="name")
236
+ uid: str = Field(..., alias="uid")
237
+ terraform_username: Optional[str] = Field(..., alias="terraformUsername")
238
+ automation_token: VaultSecret = Field(..., alias="automationToken")
239
+
240
+
241
+ class ClusterPeeringConnectionAccountVPCMeshV1(ClusterPeeringConnectionV1):
242
+ account: ClusterPeeringConnectionAccountVPCMeshV1_AWSAccountV1 = Field(
243
+ ..., alias="account"
244
+ )
245
+ tags: Optional[Json] = Field(..., alias="tags")
246
+
247
+
248
+ class ClusterPeeringConnectionAccountTGWV1_AWSAccountV1(ConfiguredBaseModel):
249
+ name: str = Field(..., alias="name")
250
+ uid: str = Field(..., alias="uid")
251
+ terraform_username: Optional[str] = Field(..., alias="terraformUsername")
252
+ automation_token: VaultSecret = Field(..., alias="automationToken")
253
+
254
+
255
+ class ClusterPeeringConnectionAccountTGWV1(ClusterPeeringConnectionV1):
256
+ account: ClusterPeeringConnectionAccountTGWV1_AWSAccountV1 = Field(
257
+ ..., alias="account"
258
+ )
259
+ tags: Optional[Json] = Field(..., alias="tags")
260
+ cidr_block: Optional[str] = Field(..., alias="cidrBlock")
261
+ manage_security_groups: Optional[bool] = Field(..., alias="manageSecurityGroups")
262
+ manage_route53_associations: Optional[bool] = Field(
263
+ ..., alias="manageRoute53Associations"
264
+ )
265
+ assume_role: Optional[str] = Field(..., alias="assumeRole")
266
+
267
+
268
+ class ClusterPeeringConnectionClusterRequesterV1_ClusterV1_ClusterNetworkV1(
269
+ ConfiguredBaseModel
270
+ ):
271
+ vpc: str = Field(..., alias="vpc")
272
+
273
+
274
+ class ClusterPeeringConnectionClusterRequesterV1_ClusterV1_ClusterSpecV1(
275
+ ConfiguredBaseModel
276
+ ):
277
+ region: str = Field(..., alias="region")
278
+
279
+
280
+ class ClusterPeeringConnectionClusterRequesterV1_ClusterV1_ClusterPeeringV1_ClusterPeeringConnectionV1(
281
+ ConfiguredBaseModel
282
+ ):
283
+ name: str = Field(..., alias="name")
284
+ provider: str = Field(..., alias="provider")
285
+ manage_routes: Optional[bool] = Field(..., alias="manageRoutes")
286
+
287
+
288
+ class ClusterPeeringConnectionClusterAccepterV1_ClusterV1(ConfiguredBaseModel):
289
+ name: str = Field(..., alias="name")
290
+
291
+
292
+ class ClusterPeeringConnectionClusterAccepterV1_AWSAccountV1(ConfiguredBaseModel):
293
+ name: str = Field(..., alias="name")
294
+ uid: str = Field(..., alias="uid")
295
+ terraform_username: Optional[str] = Field(..., alias="terraformUsername")
296
+ automation_token: VaultSecret = Field(..., alias="automationToken")
297
+
298
+
299
+ class ClusterPeeringConnectionClusterAccepterV1(
300
+ ClusterPeeringConnectionClusterRequesterV1_ClusterV1_ClusterPeeringV1_ClusterPeeringConnectionV1
301
+ ):
302
+ name: str = Field(..., alias="name")
303
+ cluster: ClusterPeeringConnectionClusterAccepterV1_ClusterV1 = Field(
304
+ ..., alias="cluster"
305
+ )
306
+ aws_infrastructure_management_account: Optional[
307
+ ClusterPeeringConnectionClusterAccepterV1_AWSAccountV1
308
+ ] = Field(..., alias="awsInfrastructureManagementAccount")
309
+
310
+
311
+ class ClusterPeeringConnectionClusterRequesterV1_ClusterV1_ClusterPeeringV1(
312
+ ConfiguredBaseModel
313
+ ):
314
+ connections: list[
315
+ Union[
316
+ ClusterPeeringConnectionClusterAccepterV1,
317
+ ClusterPeeringConnectionClusterRequesterV1_ClusterV1_ClusterPeeringV1_ClusterPeeringConnectionV1,
318
+ ]
319
+ ] = Field(..., alias="connections")
320
+
321
+
322
+ class ClusterPeeringConnectionClusterRequesterV1_ClusterV1(ConfiguredBaseModel):
323
+ name: str = Field(..., alias="name")
324
+ network: Optional[
325
+ ClusterPeeringConnectionClusterRequesterV1_ClusterV1_ClusterNetworkV1
326
+ ] = Field(..., alias="network")
327
+ spec: Optional[
328
+ ClusterPeeringConnectionClusterRequesterV1_ClusterV1_ClusterSpecV1
329
+ ] = Field(..., alias="spec")
330
+ aws_infrastructure_management_accounts: Optional[
331
+ list[AWSInfrastructureManagementAccount]
332
+ ] = Field(..., alias="awsInfrastructureManagementAccounts")
333
+ peering: Optional[
334
+ ClusterPeeringConnectionClusterRequesterV1_ClusterV1_ClusterPeeringV1
335
+ ] = Field(..., alias="peering")
336
+
337
+
338
+ class ClusterPeeringConnectionClusterRequesterV1(ClusterPeeringConnectionV1):
339
+ cluster: ClusterPeeringConnectionClusterRequesterV1_ClusterV1 = Field(
340
+ ..., alias="cluster"
341
+ )
342
+
343
+
344
+ class ClusterPeeringV1(ConfiguredBaseModel):
345
+ connections: list[
346
+ Union[
347
+ ClusterPeeringConnectionAccountTGWV1,
348
+ ClusterPeeringConnectionAccountV1,
349
+ ClusterPeeringConnectionAccountVPCMeshV1,
350
+ ClusterPeeringConnectionClusterRequesterV1,
351
+ ClusterPeeringConnectionV1,
352
+ ]
353
+ ] = Field(..., alias="connections")
354
+
355
+
356
+ class DisableClusterAutomationsV1(ConfiguredBaseModel):
357
+ integrations: Optional[list[str]] = Field(..., alias="integrations")
358
+
359
+
360
+ class ClusterV1(ConfiguredBaseModel):
361
+ path: str = Field(..., alias="path")
362
+ name: str = Field(..., alias="name")
363
+ ocm: Optional[OpenShiftClusterManagerV1] = Field(..., alias="ocm")
364
+ aws_infrastructure_management_accounts: Optional[
365
+ list[AWSInfrastructureManagementAccount]
366
+ ] = Field(..., alias="awsInfrastructureManagementAccounts")
367
+ spec: Optional[ClusterSpecV1] = Field(..., alias="spec")
368
+ network: Optional[ClusterNetworkV1] = Field(..., alias="network")
369
+ peering: Optional[ClusterPeeringV1] = Field(..., alias="peering")
370
+ disable: Optional[DisableClusterAutomationsV1] = Field(..., alias="disable")
371
+
372
+
373
+ class ClustersWithPeeringQueryData(ConfiguredBaseModel):
374
+ clusters: Optional[list[ClusterV1]] = Field(..., alias="clusters")
375
+
376
+
377
+ def query(query_func: Callable, **kwargs: Any) -> ClustersWithPeeringQueryData:
378
+ """
379
+ This is a convenience function which queries and parses the data into
380
+ concrete types. It should be compatible with most GQL clients.
381
+ You do not have to use it to consume the generated data classes.
382
+ Alternatively, you can also mime and alternate the behavior
383
+ of this function in the caller.
384
+
385
+ Parameters:
386
+ query_func (Callable): Function which queries your GQL Server
387
+ kwargs: optional arguments that will be passed to the query function
388
+
389
+ Returns:
390
+ ClustersWithPeeringQueryData: queried data parsed into generated classes
391
+ """
392
+ raw_data: dict[Any, Any] = query_func(DEFINITION, **kwargs)
393
+ return ClustersWithPeeringQueryData(**raw_data)
@@ -87,12 +87,8 @@ class TerraformCloudflareDNSIntegration(
87
87
  def name(self) -> str:
88
88
  return self.qontract_integration.replace("_", "-")
89
89
 
90
- def run(self, dry_run: bool) -> None:
91
- self.run_with_defer(dry_run) # pylint: disable=no-value-for-parameter
92
-
93
90
  @defer
94
- def run_with_defer(self, dry_run: bool, defer: Callable) -> None:
95
-
91
+ def run(self, dry_run: bool, defer: Optional[Callable] = None) -> None:
96
92
  settings = self._get_app_interface_settings()
97
93
 
98
94
  if not settings.settings:
@@ -173,7 +169,8 @@ class TerraformCloudflareDNSIntegration(
173
169
  self.params.thread_pool_size,
174
170
  )
175
171
 
176
- defer(tf.cleanup)
172
+ if defer:
173
+ defer(tf.cleanup)
177
174
 
178
175
  disabled_deletions_detected, err = tf.plan(self.params.enable_deletion)
179
176
  if err:
@@ -0,0 +1,11 @@
1
+ from reconcile.gql_definitions.common.clusters_with_peering import (
2
+ ClusterV1,
3
+ query,
4
+ )
5
+ from reconcile.utils.gql import GqlApi
6
+
7
+
8
+ def get_clusters_with_peering(gql_api: GqlApi) -> list[ClusterV1]:
9
+ data = query(gql_api.query)
10
+ clusters = data.clusters or []
11
+ return [c for c in clusters if c.peering is not None]
reconcile/utils/gql.py CHANGED
@@ -24,8 +24,6 @@ from sretoolbox.utils import retry
24
24
  from reconcile.status import RunningState
25
25
  from reconcile.utils.config import get_config
26
26
 
27
- _gqlapi = None
28
-
29
27
  INTEGRATIONS_QUERY = """
30
28
  {
31
29
  integrations: integrations_v1 {
@@ -221,6 +219,9 @@ class GqlApi:
221
219
  return None
222
220
 
223
221
 
222
+ _gqlapi: Optional[GqlApi] = None
223
+
224
+
224
225
  def init(
225
226
  url: str,
226
227
  token: Optional[str] = None,
@@ -323,10 +324,10 @@ def _get_gql_server_and_token(
323
324
  return server, token, None, None
324
325
 
325
326
 
326
- def get_api():
327
+ def get_api() -> GqlApi:
327
328
  global _gqlapi
328
329
 
329
- if not _gqlapi:
330
+ if _gqlapi is None:
330
331
  raise GqlApiError("gql module has not been initialized.")
331
332
 
332
333
  return _gqlapi