qontract-reconcile 0.10.2.dev414__py3-none-any.whl → 0.10.2.dev456__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.
Potentially problematic release.
This version of qontract-reconcile might be problematic. Click here for more details.
- {qontract_reconcile-0.10.2.dev414.dist-info → qontract_reconcile-0.10.2.dev456.dist-info}/METADATA +2 -2
- {qontract_reconcile-0.10.2.dev414.dist-info → qontract_reconcile-0.10.2.dev456.dist-info}/RECORD +55 -53
- {qontract_reconcile-0.10.2.dev414.dist-info → qontract_reconcile-0.10.2.dev456.dist-info}/WHEEL +1 -1
- reconcile/aus/advanced_upgrade_service.py +3 -0
- reconcile/aus/aus_sts_gate_handler.py +59 -0
- reconcile/aus/base.py +115 -8
- reconcile/aus/models.py +2 -0
- reconcile/aus/ocm_addons_upgrade_scheduler_org.py +1 -0
- reconcile/aus/ocm_upgrade_scheduler.py +8 -1
- reconcile/aus/ocm_upgrade_scheduler_org.py +20 -5
- reconcile/aus/version_gate_approver.py +1 -16
- reconcile/aus/version_gates/sts_version_gate_handler.py +5 -72
- reconcile/automated_actions/config/integration.py +1 -1
- reconcile/aws_ecr_image_pull_secrets.py +1 -1
- reconcile/change_owners/change_owners.py +100 -34
- reconcile/cli.py +63 -5
- reconcile/external_resources/manager.py +7 -18
- reconcile/external_resources/model.py +8 -8
- reconcile/external_resources/secrets_sync.py +2 -3
- reconcile/external_resources/state.py +1 -34
- reconcile/gql_definitions/common/aws_vpc_requests.py +3 -0
- reconcile/gql_definitions/common/clusters.py +2 -0
- reconcile/gql_definitions/external_resources/external_resources_namespaces.py +3 -1
- reconcile/gql_definitions/fragments/aws_vpc_request.py +5 -0
- reconcile/gql_definitions/introspection.json +48 -0
- reconcile/gql_definitions/rhcs/certs.py +20 -74
- reconcile/gql_definitions/rhcs/openshift_resource_rhcs_cert.py +43 -0
- reconcile/gql_definitions/terraform_resources/terraform_resources_namespaces.py +5 -1
- reconcile/gql_definitions/vpc_peerings_validator/vpc_peerings_validator.py +3 -0
- reconcile/gql_definitions/vpc_peerings_validator/vpc_peerings_validator_peered_cluster_fragment.py +1 -0
- reconcile/ocm_machine_pools.py +12 -6
- reconcile/openshift_base.py +60 -2
- reconcile/openshift_namespaces.py +3 -4
- reconcile/openshift_rhcs_certs.py +71 -34
- reconcile/rhidp/sso_client/base.py +15 -4
- reconcile/templates/rosa-classic-cluster-creation.sh.j2 +1 -1
- reconcile/templates/rosa-hcp-cluster-creation.sh.j2 +1 -1
- reconcile/terraform_vpc_resources/integration.py +10 -7
- reconcile/typed_queries/saas_files.py +9 -4
- reconcile/utils/binary.py +7 -12
- reconcile/utils/environ.py +5 -0
- reconcile/utils/gitlab_api.py +12 -0
- reconcile/utils/glitchtip/client.py +2 -2
- reconcile/utils/jjb_client.py +19 -3
- reconcile/utils/jobcontroller/controller.py +1 -1
- reconcile/utils/json.py +5 -1
- reconcile/utils/oc.py +144 -113
- reconcile/utils/rhcsv2_certs.py +87 -21
- reconcile/utils/rosa/session.py +16 -0
- reconcile/utils/saasherder/saasherder.py +20 -7
- reconcile/utils/terrascript_aws_client.py +140 -50
- reconcile/utils/vault.py +1 -1
- reconcile/vpc_peerings_validator.py +13 -0
- tools/cli_commands/erv2.py +1 -3
- {qontract_reconcile-0.10.2.dev414.dist-info → qontract_reconcile-0.10.2.dev456.dist-info}/entry_points.txt +0 -0
reconcile/cli.py
CHANGED
|
@@ -50,10 +50,10 @@ from reconcile.utils.unleash import get_feature_toggle_state
|
|
|
50
50
|
TERRAFORM_VERSION = ["1.6.6"]
|
|
51
51
|
TERRAFORM_VERSION_REGEX = r"^Terraform\sv([\d]+\.[\d]+\.[\d]+)$"
|
|
52
52
|
|
|
53
|
-
OC_VERSIONS = ["4.
|
|
54
|
-
OC_VERSION_REGEX = r"^Client\sVersion:\s([\d]+\.[\d]+\.[\d]+)
|
|
53
|
+
OC_VERSIONS = ["4.19.0", "4.16.2"]
|
|
54
|
+
OC_VERSION_REGEX = r"^Client\sVersion:\s([\d]+\.[\d]+\.[\d]+)"
|
|
55
55
|
|
|
56
|
-
HELM_VERSIONS = ["3.
|
|
56
|
+
HELM_VERSIONS = ["3.19.2"]
|
|
57
57
|
HELM_VERSION_REGEX = r"^version.BuildInfo{Version:\"v([\d]+\.[\d]+\.[\d]+)\".*$"
|
|
58
58
|
|
|
59
59
|
|
|
@@ -2855,6 +2855,36 @@ def ocm_addons_upgrade_scheduler_org(
|
|
|
2855
2855
|
default=bool(os.environ.get("IGNORE_STS_CLUSTERS")),
|
|
2856
2856
|
help="Ignore STS clusters",
|
|
2857
2857
|
)
|
|
2858
|
+
@click.option(
|
|
2859
|
+
"--job-controller-cluster",
|
|
2860
|
+
help="The cluster holding the job-controller namepsace",
|
|
2861
|
+
required=False,
|
|
2862
|
+
envvar="JOB_CONTROLLER_CLUSTER",
|
|
2863
|
+
)
|
|
2864
|
+
@click.option(
|
|
2865
|
+
"--job-controller-namespace",
|
|
2866
|
+
help="The namespace used for ROSA jobs",
|
|
2867
|
+
required=False,
|
|
2868
|
+
envvar="JOB_CONTROLLER_NAMESPACE",
|
|
2869
|
+
)
|
|
2870
|
+
@click.option(
|
|
2871
|
+
"--rosa-job-service-account",
|
|
2872
|
+
help="The service-account used for ROSA jobs",
|
|
2873
|
+
required=False,
|
|
2874
|
+
envvar="ROSA_JOB_SERVICE_ACCOUNT",
|
|
2875
|
+
)
|
|
2876
|
+
@click.option(
|
|
2877
|
+
"--rosa-job-image",
|
|
2878
|
+
help="The container image to use to run ROSA cli command jobs",
|
|
2879
|
+
required=False,
|
|
2880
|
+
envvar="ROSA_JOB_IMAGE",
|
|
2881
|
+
)
|
|
2882
|
+
@click.option(
|
|
2883
|
+
"--rosa-role",
|
|
2884
|
+
help="The role to assume in the ROSA cluster account",
|
|
2885
|
+
required=False,
|
|
2886
|
+
envvar="ROSA_ROLE",
|
|
2887
|
+
)
|
|
2858
2888
|
@click.pass_context
|
|
2859
2889
|
def advanced_upgrade_scheduler(
|
|
2860
2890
|
ctx: click.Context,
|
|
@@ -2862,9 +2892,21 @@ def advanced_upgrade_scheduler(
|
|
|
2862
2892
|
org_id: Iterable[str],
|
|
2863
2893
|
exclude_org_id: Iterable[str],
|
|
2864
2894
|
ignore_sts_clusters: bool,
|
|
2895
|
+
job_controller_cluster: str | None,
|
|
2896
|
+
job_controller_namespace: str | None,
|
|
2897
|
+
rosa_job_service_account: str | None,
|
|
2898
|
+
rosa_role: str | None,
|
|
2899
|
+
rosa_job_image: str | None,
|
|
2865
2900
|
) -> None:
|
|
2866
|
-
from reconcile.aus.advanced_upgrade_service import
|
|
2867
|
-
|
|
2901
|
+
from reconcile.aus.advanced_upgrade_service import (
|
|
2902
|
+
QONTRACT_INTEGRATION,
|
|
2903
|
+
QONTRACT_INTEGRATION_VERSION,
|
|
2904
|
+
AdvancedUpgradeServiceIntegration,
|
|
2905
|
+
)
|
|
2906
|
+
from reconcile.aus.base import (
|
|
2907
|
+
AdvancedUpgradeSchedulerBaseIntegrationParams,
|
|
2908
|
+
RosaRoleUpgradeHandlerParams,
|
|
2909
|
+
)
|
|
2868
2910
|
|
|
2869
2911
|
run_class_integration(
|
|
2870
2912
|
integration=AdvancedUpgradeServiceIntegration(
|
|
@@ -2873,6 +2915,22 @@ def advanced_upgrade_scheduler(
|
|
|
2873
2915
|
ocm_organization_ids=set(org_id),
|
|
2874
2916
|
excluded_ocm_organization_ids=set(exclude_org_id),
|
|
2875
2917
|
ignore_sts_clusters=ignore_sts_clusters,
|
|
2918
|
+
rosa_role_upgrade_handler_params=RosaRoleUpgradeHandlerParams(
|
|
2919
|
+
job_controller_cluster=job_controller_cluster,
|
|
2920
|
+
job_controller_namespace=job_controller_namespace,
|
|
2921
|
+
rosa_job_service_account=rosa_job_service_account,
|
|
2922
|
+
rosa_role=rosa_role,
|
|
2923
|
+
rosa_job_image=rosa_job_image,
|
|
2924
|
+
integration_name=QONTRACT_INTEGRATION,
|
|
2925
|
+
integration_version=QONTRACT_INTEGRATION_VERSION,
|
|
2926
|
+
)
|
|
2927
|
+
if all([
|
|
2928
|
+
job_controller_cluster,
|
|
2929
|
+
job_controller_namespace,
|
|
2930
|
+
rosa_job_service_account,
|
|
2931
|
+
rosa_role,
|
|
2932
|
+
])
|
|
2933
|
+
else None,
|
|
2876
2934
|
)
|
|
2877
2935
|
),
|
|
2878
2936
|
ctx=ctx,
|
|
@@ -45,7 +45,6 @@ from reconcile.utils.datetime_util import utc_now
|
|
|
45
45
|
from reconcile.utils.external_resource_spec import (
|
|
46
46
|
ExternalResourceSpec,
|
|
47
47
|
)
|
|
48
|
-
from reconcile.utils.json import json_dumps
|
|
49
48
|
from reconcile.utils.secret_reader import SecretReaderBase
|
|
50
49
|
|
|
51
50
|
|
|
@@ -245,7 +244,7 @@ class ExternalResourcesManager:
|
|
|
245
244
|
reconciliation = Reconciliation(
|
|
246
245
|
key=key,
|
|
247
246
|
resource_hash=resource.hash(),
|
|
248
|
-
input=
|
|
247
|
+
input=resource.export(),
|
|
249
248
|
action=Action.APPLY,
|
|
250
249
|
module_configuration=module_conf,
|
|
251
250
|
linked_resources=self._find_linked_resources(spec),
|
|
@@ -253,15 +252,11 @@ class ExternalResourcesManager:
|
|
|
253
252
|
r.add(reconciliation)
|
|
254
253
|
return r
|
|
255
254
|
|
|
256
|
-
def _get_deleted_objects_reconciliations(
|
|
257
|
-
self, enable_migration: bool = False
|
|
258
|
-
) -> set[Reconciliation]:
|
|
255
|
+
def _get_deleted_objects_reconciliations(self) -> set[Reconciliation]:
|
|
259
256
|
to_reconcile: set[Reconciliation] = set()
|
|
260
257
|
deleted_keys = (k for k, v in self.er_inventory.items() if v.marked_to_delete)
|
|
261
258
|
for key in deleted_keys:
|
|
262
|
-
state = self.state_mgr.get_external_resource_state(
|
|
263
|
-
key, enable_migration=enable_migration
|
|
264
|
-
)
|
|
259
|
+
state = self.state_mgr.get_external_resource_state(key)
|
|
265
260
|
if state.resource_status == ResourceStatus.NOT_EXISTS:
|
|
266
261
|
logging.debug("Resource has already been removed. key: %s", key)
|
|
267
262
|
continue
|
|
@@ -354,9 +349,7 @@ class ExternalResourcesManager:
|
|
|
354
349
|
|
|
355
350
|
if r.linked_resources:
|
|
356
351
|
for lr in r.linked_resources:
|
|
357
|
-
lrs = self.state_mgr.get_external_resource_state(
|
|
358
|
-
lr, enable_migration=True
|
|
359
|
-
)
|
|
352
|
+
lrs = self.state_mgr.get_external_resource_state(lr)
|
|
360
353
|
if not lrs.resource_status.is_in_progress:
|
|
361
354
|
lrs.resource_status = ResourceStatus.RECONCILIATION_REQUESTED
|
|
362
355
|
self.state_mgr.set_external_resource_state(lrs)
|
|
@@ -423,12 +416,10 @@ class ExternalResourcesManager:
|
|
|
423
416
|
|
|
424
417
|
def handle_resources(self) -> None:
|
|
425
418
|
desired_r = self._get_desired_objects_reconciliations()
|
|
426
|
-
deleted_r = self._get_deleted_objects_reconciliations(
|
|
419
|
+
deleted_r = self._get_deleted_objects_reconciliations()
|
|
427
420
|
to_sync_keys: set[ExternalResourceKey] = set()
|
|
428
421
|
for r in desired_r.union(deleted_r):
|
|
429
|
-
state = self.state_mgr.get_external_resource_state(
|
|
430
|
-
r.key, enable_migration=True
|
|
431
|
-
)
|
|
422
|
+
state = self.state_mgr.get_external_resource_state(r.key)
|
|
432
423
|
reconciliation_status = self._get_reconciliation_status(r, state)
|
|
433
424
|
self._update_resource_state(r, state, reconciliation_status)
|
|
434
425
|
|
|
@@ -460,9 +451,7 @@ class ExternalResourcesManager:
|
|
|
460
451
|
for r in desired_r.union(deleted_r)
|
|
461
452
|
if self._reconciliation_needs_dry_run_run(
|
|
462
453
|
r,
|
|
463
|
-
self.state_mgr.get_external_resource_state(
|
|
464
|
-
key=r.key, enable_migration=False
|
|
465
|
-
),
|
|
454
|
+
self.state_mgr.get_external_resource_state(key=r.key),
|
|
466
455
|
)
|
|
467
456
|
}
|
|
468
457
|
|
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
import hashlib
|
|
2
|
-
from abc import (
|
|
3
|
-
ABC,
|
|
4
|
-
)
|
|
5
2
|
from collections.abc import ItemsView, Iterable, Iterator, MutableMapping
|
|
6
3
|
from enum import StrEnum
|
|
7
4
|
from typing import Any
|
|
@@ -88,9 +85,6 @@ class ExternalResourceKey(BaseModel, frozen=True):
|
|
|
88
85
|
provider=spec.provider,
|
|
89
86
|
)
|
|
90
87
|
|
|
91
|
-
def hash(self) -> str:
|
|
92
|
-
return hashlib.md5(json_dumps(self.model_dump()).encode("utf-8")).hexdigest()
|
|
93
|
-
|
|
94
88
|
@property
|
|
95
89
|
def state_path(self) -> str:
|
|
96
90
|
return f"{self.provision_provider}/{self.provisioner_name}/{self.provider}/{self.identifier}"
|
|
@@ -407,7 +401,7 @@ class ReconciliationStatus(BaseModel):
|
|
|
407
401
|
resource_status: ResourceStatus
|
|
408
402
|
|
|
409
403
|
|
|
410
|
-
class ModuleProvisionData(
|
|
404
|
+
class ModuleProvisionData(BaseModel):
|
|
411
405
|
pass
|
|
412
406
|
|
|
413
407
|
|
|
@@ -432,7 +426,7 @@ class ExternalResourceProvision(BaseModel):
|
|
|
432
426
|
target_cluster: str
|
|
433
427
|
target_namespace: str
|
|
434
428
|
target_secret_name: str
|
|
435
|
-
module_provision_data: ModuleProvisionData
|
|
429
|
+
module_provision_data: ModuleProvisionData | TerraformModuleProvisionData
|
|
436
430
|
|
|
437
431
|
|
|
438
432
|
class ExternalResource(BaseModel):
|
|
@@ -441,3 +435,9 @@ class ExternalResource(BaseModel):
|
|
|
441
435
|
|
|
442
436
|
def hash(self) -> str:
|
|
443
437
|
return hashlib.sha256(json_dumps(self.data).encode("utf-8")).hexdigest()
|
|
438
|
+
|
|
439
|
+
def export(
|
|
440
|
+
self, exclude: dict[str, Any] | None = None, indent: int | None = None
|
|
441
|
+
) -> str:
|
|
442
|
+
"""Export the ExternalResource as a JSON string."""
|
|
443
|
+
return json_dumps(self, exclude=exclude, indent=indent)
|
|
@@ -448,9 +448,8 @@ class VaultSecretsReconciler(SecretsReconciler):
|
|
|
448
448
|
secret_path = self.secret_path(self.vault_path, spec)
|
|
449
449
|
try:
|
|
450
450
|
logging.debug("Reading Secret %s", secret_path)
|
|
451
|
-
data = self.secrets_reader.read_all({"path": secret_path})
|
|
452
|
-
spec.metadata[SECRET_UPDATED_AT] = data
|
|
453
|
-
del data[SECRET_UPDATED_AT]
|
|
451
|
+
data = self.secrets_reader.read_all({"path": secret_path}).copy()
|
|
452
|
+
spec.metadata[SECRET_UPDATED_AT] = data.pop(SECRET_UPDATED_AT)
|
|
454
453
|
spec.secret = data
|
|
455
454
|
except SecretNotFoundError:
|
|
456
455
|
logging.info("Error getting secret from vault, skipping. [%s]", secret_path)
|
|
@@ -271,47 +271,14 @@ class ExternalResourcesStateDynamoDB:
|
|
|
271
271
|
def get_external_resource_state(
|
|
272
272
|
self,
|
|
273
273
|
key: ExternalResourceKey,
|
|
274
|
-
enable_migration: bool = False,
|
|
275
274
|
) -> ExternalResourceState:
|
|
276
275
|
data = self.aws_api.dynamodb.boto3_client.get_item(
|
|
277
276
|
TableName=self._table,
|
|
278
277
|
ConsistentRead=True,
|
|
279
278
|
Key={self.adapter.ER_KEY_HASH: {"S": key.state_path}},
|
|
280
279
|
)
|
|
281
|
-
|
|
282
|
-
if item:
|
|
280
|
+
if "Item" in data:
|
|
283
281
|
return self.adapter.deserialize(data["Item"])
|
|
284
|
-
|
|
285
|
-
old_data = self.aws_api.dynamodb.boto3_client.get_item(
|
|
286
|
-
TableName=self._table,
|
|
287
|
-
ConsistentRead=True,
|
|
288
|
-
Key={self.adapter.ER_KEY_HASH: {"S": key.hash()}},
|
|
289
|
-
)
|
|
290
|
-
old_item = old_data.get("Item")
|
|
291
|
-
if old_item:
|
|
292
|
-
old_item[self.adapter.ER_KEY_HASH]["S"] = key.state_path
|
|
293
|
-
old_item[self.adapter.RECONC]["M"][self.adapter.RECONC_RESOURCE_HASH][
|
|
294
|
-
"S"
|
|
295
|
-
] = self._new_sha256_hash(old_item)
|
|
296
|
-
if enable_migration:
|
|
297
|
-
self.aws_api.dynamodb.boto3_client.transact_write_items(
|
|
298
|
-
TransactItems=[
|
|
299
|
-
{
|
|
300
|
-
"Put": {
|
|
301
|
-
"TableName": self._table,
|
|
302
|
-
"Item": old_item,
|
|
303
|
-
}
|
|
304
|
-
},
|
|
305
|
-
{
|
|
306
|
-
"Delete": {
|
|
307
|
-
"TableName": self._table,
|
|
308
|
-
"Key": {self.adapter.ER_KEY_HASH: {"S": key.hash()}},
|
|
309
|
-
}
|
|
310
|
-
},
|
|
311
|
-
]
|
|
312
|
-
)
|
|
313
|
-
return self.adapter.deserialize(old_item)
|
|
314
|
-
|
|
315
282
|
return ExternalResourceState(
|
|
316
283
|
key=key,
|
|
317
284
|
ts=utc_now(),
|
|
@@ -113,6 +113,7 @@ query Clusters($name: String) {
|
|
|
113
113
|
managedGroups
|
|
114
114
|
managedClusterRoles
|
|
115
115
|
insecureSkipTLSVerify
|
|
116
|
+
allowedToBypassPublicPeeringRestriction
|
|
116
117
|
jumpHost {
|
|
117
118
|
...CommonJumphostFields
|
|
118
119
|
}
|
|
@@ -635,6 +636,7 @@ class ClusterV1(ConfiguredBaseModel):
|
|
|
635
636
|
managed_groups: Optional[list[str]] = Field(..., alias="managedGroups")
|
|
636
637
|
managed_cluster_roles: Optional[bool] = Field(..., alias="managedClusterRoles")
|
|
637
638
|
insecure_skip_tls_verify: Optional[bool] = Field(..., alias="insecureSkipTLSVerify")
|
|
639
|
+
allowed_to_bypass_public_peering_restriction: Optional[bool] = Field(..., alias="allowedToBypassPublicPeeringRestriction")
|
|
638
640
|
jump_host: Optional[CommonJumphostFields] = Field(..., alias="jumpHost")
|
|
639
641
|
auth: list[Union[ClusterAuthGithubOrgTeamV1, ClusterAuthGithubOrgV1, ClusterAuthV1]] = Field(..., alias="auth")
|
|
640
642
|
ocm: Optional[OpenShiftClusterManagerV1] = Field(..., alias="ocm")
|
|
@@ -372,6 +372,7 @@ query ExternalResourcesNamespaces {
|
|
|
372
372
|
identifier
|
|
373
373
|
defaults
|
|
374
374
|
es_identifier
|
|
375
|
+
policy
|
|
375
376
|
output_resource_name
|
|
376
377
|
annotations
|
|
377
378
|
tags
|
|
@@ -933,6 +934,7 @@ class NamespaceTerraformResourceKinesisV1(NamespaceTerraformResourceAWSV1):
|
|
|
933
934
|
identifier: str = Field(..., alias="identifier")
|
|
934
935
|
defaults: str = Field(..., alias="defaults")
|
|
935
936
|
es_identifier: Optional[str] = Field(..., alias="es_identifier")
|
|
937
|
+
policy: Optional[str] = Field(..., alias="policy")
|
|
936
938
|
output_resource_name: Optional[str] = Field(..., alias="output_resource_name")
|
|
937
939
|
annotations: Optional[str] = Field(..., alias="annotations")
|
|
938
940
|
tags: Optional[str] = Field(..., alias="tags")
|
|
@@ -1167,7 +1169,7 @@ class NamespaceTerraformResourceMskV1(NamespaceTerraformResourceAWSV1):
|
|
|
1167
1169
|
|
|
1168
1170
|
class NamespaceTerraformProviderResourceAWSV1(NamespaceExternalResourceV1):
|
|
1169
1171
|
provisioner: AWSAccountV1 = Field(..., alias="provisioner")
|
|
1170
|
-
resources: list[Union[NamespaceTerraformResourceRDSV1, NamespaceTerraformResourceRosaAuthenticatorV1, NamespaceTerraformResourceALBV1, NamespaceTerraformResourceS3V1, NamespaceTerraformResourceElastiCacheV1, NamespaceTerraformResourceCloudWatchV1, NamespaceTerraformResourceASGV1, NamespaceTerraformResourceRDSProxyV1, NamespaceTerraformResourceRoleV1, NamespaceTerraformResourceKMSV1, NamespaceTerraformResourceMskV1, NamespaceTerraformResourceSNSTopicV1, NamespaceTerraformResourceServiceAccountV1, NamespaceTerraformResourceS3SQSV1, NamespaceTerraformResourceRosaAuthenticatorVPCEV1, NamespaceTerraformResourceS3CloudFrontV1, NamespaceTerraformResourceElasticSearchV1, NamespaceTerraformResourceACMV1,
|
|
1172
|
+
resources: list[Union[NamespaceTerraformResourceRDSV1, NamespaceTerraformResourceRosaAuthenticatorV1, NamespaceTerraformResourceALBV1, NamespaceTerraformResourceS3V1, NamespaceTerraformResourceElastiCacheV1, NamespaceTerraformResourceCloudWatchV1, NamespaceTerraformResourceASGV1, NamespaceTerraformResourceRDSProxyV1, NamespaceTerraformResourceRoleV1, NamespaceTerraformResourceKMSV1, NamespaceTerraformResourceMskV1, NamespaceTerraformResourceSNSTopicV1, NamespaceTerraformResourceServiceAccountV1, NamespaceTerraformResourceS3SQSV1, NamespaceTerraformResourceKinesisV1, NamespaceTerraformResourceRosaAuthenticatorVPCEV1, NamespaceTerraformResourceS3CloudFrontV1, NamespaceTerraformResourceElasticSearchV1, NamespaceTerraformResourceACMV1, NamespaceTerraformResourceRoute53ZoneV1, NamespaceTerraformResourceSQSV1, NamespaceTerraformResourceDynamoDBV1, NamespaceTerraformResourceECRV1, NamespaceTerraformResourceS3CloudFrontPublicKeyV1, NamespaceTerraformResourceSecretsManagerV1, NamespaceTerraformResourceSecretsManagerServiceAccountV1, NamespaceTerraformResourceAWSV1]] = Field(..., alias="resources")
|
|
1171
1173
|
|
|
1172
1174
|
|
|
1173
1175
|
class EnvironmentV1(ConfiguredBaseModel):
|
|
@@ -28,6 +28,10 @@ class ConfiguredBaseModel(BaseModel):
|
|
|
28
28
|
)
|
|
29
29
|
|
|
30
30
|
|
|
31
|
+
class DisableClusterAutomationsV1(ConfiguredBaseModel):
|
|
32
|
+
integrations: Optional[list[str]] = Field(..., alias="integrations")
|
|
33
|
+
|
|
34
|
+
|
|
31
35
|
class DeletionApprovalV1(ConfiguredBaseModel):
|
|
32
36
|
q_type: str = Field(..., alias="type")
|
|
33
37
|
name: str = Field(..., alias="name")
|
|
@@ -39,6 +43,7 @@ class AWSAccountV1(ConfiguredBaseModel):
|
|
|
39
43
|
uid: str = Field(..., alias="uid")
|
|
40
44
|
terraform_username: Optional[str] = Field(..., alias="terraformUsername")
|
|
41
45
|
automation_token: VaultSecret = Field(..., alias="automationToken")
|
|
46
|
+
disable: Optional[DisableClusterAutomationsV1] = Field(..., alias="disable")
|
|
42
47
|
supported_deployment_regions: Optional[list[str]] = Field(..., alias="supportedDeploymentRegions")
|
|
43
48
|
resources_default_region: str = Field(..., alias="resourcesDefaultRegion")
|
|
44
49
|
provider_version: str = Field(..., alias="providerVersion")
|
|
@@ -6489,6 +6489,18 @@
|
|
|
6489
6489
|
"isDeprecated": false,
|
|
6490
6490
|
"deprecationReason": null
|
|
6491
6491
|
},
|
|
6492
|
+
{
|
|
6493
|
+
"name": "allowedToBypassPublicPeeringRestriction",
|
|
6494
|
+
"description": null,
|
|
6495
|
+
"args": [],
|
|
6496
|
+
"type": {
|
|
6497
|
+
"kind": "SCALAR",
|
|
6498
|
+
"name": "Boolean",
|
|
6499
|
+
"ofType": null
|
|
6500
|
+
},
|
|
6501
|
+
"isDeprecated": false,
|
|
6502
|
+
"deprecationReason": null
|
|
6503
|
+
},
|
|
6492
6504
|
{
|
|
6493
6505
|
"name": "namespaces",
|
|
6494
6506
|
"description": null,
|
|
@@ -41646,6 +41658,18 @@
|
|
|
41646
41658
|
"isDeprecated": false,
|
|
41647
41659
|
"deprecationReason": null
|
|
41648
41660
|
},
|
|
41661
|
+
{
|
|
41662
|
+
"name": "certificate_format",
|
|
41663
|
+
"description": null,
|
|
41664
|
+
"args": [],
|
|
41665
|
+
"type": {
|
|
41666
|
+
"kind": "SCALAR",
|
|
41667
|
+
"name": "String",
|
|
41668
|
+
"ofType": null
|
|
41669
|
+
},
|
|
41670
|
+
"isDeprecated": false,
|
|
41671
|
+
"deprecationReason": null
|
|
41672
|
+
},
|
|
41649
41673
|
{
|
|
41650
41674
|
"name": "annotations",
|
|
41651
41675
|
"description": null,
|
|
@@ -47657,6 +47681,18 @@
|
|
|
47657
47681
|
},
|
|
47658
47682
|
"isDeprecated": false,
|
|
47659
47683
|
"deprecationReason": null
|
|
47684
|
+
},
|
|
47685
|
+
{
|
|
47686
|
+
"name": "bucket_policy",
|
|
47687
|
+
"description": null,
|
|
47688
|
+
"args": [],
|
|
47689
|
+
"type": {
|
|
47690
|
+
"kind": "SCALAR",
|
|
47691
|
+
"name": "JSON",
|
|
47692
|
+
"ofType": null
|
|
47693
|
+
},
|
|
47694
|
+
"isDeprecated": false,
|
|
47695
|
+
"deprecationReason": null
|
|
47660
47696
|
}
|
|
47661
47697
|
],
|
|
47662
47698
|
"inputFields": null,
|
|
@@ -48266,6 +48302,18 @@
|
|
|
48266
48302
|
"isDeprecated": false,
|
|
48267
48303
|
"deprecationReason": null
|
|
48268
48304
|
},
|
|
48305
|
+
{
|
|
48306
|
+
"name": "policy",
|
|
48307
|
+
"description": null,
|
|
48308
|
+
"args": [],
|
|
48309
|
+
"type": {
|
|
48310
|
+
"kind": "SCALAR",
|
|
48311
|
+
"name": "JSON",
|
|
48312
|
+
"ofType": null
|
|
48313
|
+
},
|
|
48314
|
+
"isDeprecated": false,
|
|
48315
|
+
"deprecationReason": null
|
|
48316
|
+
},
|
|
48269
48317
|
{
|
|
48270
48318
|
"name": "output_resource_name",
|
|
48271
48319
|
"description": null,
|
|
@@ -18,6 +18,7 @@ from pydantic import ( # noqa: F401 # pylint: disable=W0611
|
|
|
18
18
|
)
|
|
19
19
|
|
|
20
20
|
from reconcile.gql_definitions.fragments.jumphost_common_fields import CommonJumphostFields
|
|
21
|
+
from reconcile.gql_definitions.rhcs.openshift_resource_rhcs_cert import OpenshiftResourceRhcsCert
|
|
21
22
|
from reconcile.gql_definitions.fragments.vault_secret import VaultSecret
|
|
22
23
|
|
|
23
24
|
|
|
@@ -33,6 +34,21 @@ fragment CommonJumphostFields on ClusterJumpHost_v1 {
|
|
|
33
34
|
}
|
|
34
35
|
}
|
|
35
36
|
|
|
37
|
+
fragment OpenshiftResourceRhcsCert on NamespaceOpenshiftResourceRhcsCert_v1 {
|
|
38
|
+
secret_name
|
|
39
|
+
service_account_name
|
|
40
|
+
service_account_password {
|
|
41
|
+
... on VaultSecret_v1 {
|
|
42
|
+
path
|
|
43
|
+
field
|
|
44
|
+
version
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
auto_renew_threshold_days
|
|
48
|
+
certificate_format
|
|
49
|
+
annotations
|
|
50
|
+
}
|
|
51
|
+
|
|
36
52
|
fragment VaultSecret on VaultSecret_v1 {
|
|
37
53
|
path
|
|
38
54
|
field
|
|
@@ -46,37 +62,11 @@ query RhcsCerts {
|
|
|
46
62
|
delete
|
|
47
63
|
clusterAdmin
|
|
48
64
|
openshiftResources {
|
|
49
|
-
|
|
50
|
-
... on NamespaceOpenshiftResourceRhcsCert_v1 {
|
|
51
|
-
secret_name
|
|
52
|
-
service_account_name
|
|
53
|
-
service_account_password {
|
|
54
|
-
... on VaultSecret_v1 {
|
|
55
|
-
path
|
|
56
|
-
field
|
|
57
|
-
version
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
auto_renew_threshold_days
|
|
61
|
-
annotations
|
|
62
|
-
}
|
|
65
|
+
...OpenshiftResourceRhcsCert
|
|
63
66
|
}
|
|
64
67
|
sharedResources {
|
|
65
68
|
openshiftResources {
|
|
66
|
-
|
|
67
|
-
... on NamespaceOpenshiftResourceRhcsCert_v1 {
|
|
68
|
-
secret_name
|
|
69
|
-
service_account_name
|
|
70
|
-
service_account_password {
|
|
71
|
-
... on VaultSecret_v1 {
|
|
72
|
-
path
|
|
73
|
-
field
|
|
74
|
-
version
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
auto_renew_threshold_days
|
|
78
|
-
annotations
|
|
79
|
-
}
|
|
69
|
+
...OpenshiftResourceRhcsCert
|
|
80
70
|
}
|
|
81
71
|
}
|
|
82
72
|
cluster {
|
|
@@ -108,52 +98,8 @@ class ConfiguredBaseModel(BaseModel):
|
|
|
108
98
|
)
|
|
109
99
|
|
|
110
100
|
|
|
111
|
-
class NamespaceOpenshiftResourceV1(ConfiguredBaseModel):
|
|
112
|
-
provider: str = Field(..., alias="provider")
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
class VaultSecretV1(ConfiguredBaseModel):
|
|
116
|
-
...
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
class VaultSecretV1_VaultSecretV1(VaultSecretV1):
|
|
120
|
-
path: str = Field(..., alias="path")
|
|
121
|
-
field: str = Field(..., alias="field")
|
|
122
|
-
version: Optional[int] = Field(..., alias="version")
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
class NamespaceOpenshiftResourceRhcsCertV1(NamespaceOpenshiftResourceV1):
|
|
126
|
-
secret_name: str = Field(..., alias="secret_name")
|
|
127
|
-
service_account_name: str = Field(..., alias="service_account_name")
|
|
128
|
-
service_account_password: Union[VaultSecretV1_VaultSecretV1, VaultSecretV1] = Field(..., alias="service_account_password")
|
|
129
|
-
auto_renew_threshold_days: Optional[int] = Field(..., alias="auto_renew_threshold_days")
|
|
130
|
-
annotations: Optional[Json] = Field(..., alias="annotations")
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
class SharedResourcesV1_NamespaceOpenshiftResourceV1(ConfiguredBaseModel):
|
|
134
|
-
provider: str = Field(..., alias="provider")
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
class SharedResourcesV1_NamespaceOpenshiftResourceV1_NamespaceOpenshiftResourceRhcsCertV1_VaultSecretV1(ConfiguredBaseModel):
|
|
138
|
-
...
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
class SharedResourcesV1_NamespaceOpenshiftResourceV1_NamespaceOpenshiftResourceRhcsCertV1_VaultSecretV1_VaultSecretV1(SharedResourcesV1_NamespaceOpenshiftResourceV1_NamespaceOpenshiftResourceRhcsCertV1_VaultSecretV1):
|
|
142
|
-
path: str = Field(..., alias="path")
|
|
143
|
-
field: str = Field(..., alias="field")
|
|
144
|
-
version: Optional[int] = Field(..., alias="version")
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
class SharedResourcesV1_NamespaceOpenshiftResourceV1_NamespaceOpenshiftResourceRhcsCertV1(SharedResourcesV1_NamespaceOpenshiftResourceV1):
|
|
148
|
-
secret_name: str = Field(..., alias="secret_name")
|
|
149
|
-
service_account_name: str = Field(..., alias="service_account_name")
|
|
150
|
-
service_account_password: Union[SharedResourcesV1_NamespaceOpenshiftResourceV1_NamespaceOpenshiftResourceRhcsCertV1_VaultSecretV1_VaultSecretV1, SharedResourcesV1_NamespaceOpenshiftResourceV1_NamespaceOpenshiftResourceRhcsCertV1_VaultSecretV1] = Field(..., alias="service_account_password")
|
|
151
|
-
auto_renew_threshold_days: Optional[int] = Field(..., alias="auto_renew_threshold_days")
|
|
152
|
-
annotations: Optional[Json] = Field(..., alias="annotations")
|
|
153
|
-
|
|
154
|
-
|
|
155
101
|
class SharedResourcesV1(ConfiguredBaseModel):
|
|
156
|
-
openshift_resources: list[
|
|
102
|
+
openshift_resources: list[OpenshiftResourceRhcsCert] = Field(..., alias="openshiftResources")
|
|
157
103
|
|
|
158
104
|
|
|
159
105
|
class DisableClusterAutomationsV1(ConfiguredBaseModel):
|
|
@@ -175,7 +121,7 @@ class NamespaceV1(ConfiguredBaseModel):
|
|
|
175
121
|
name: str = Field(..., alias="name")
|
|
176
122
|
delete: Optional[bool] = Field(..., alias="delete")
|
|
177
123
|
cluster_admin: Optional[bool] = Field(..., alias="clusterAdmin")
|
|
178
|
-
openshift_resources: Optional[list[
|
|
124
|
+
openshift_resources: Optional[list[OpenshiftResourceRhcsCert]] = Field(..., alias="openshiftResources")
|
|
179
125
|
shared_resources: Optional[list[SharedResourcesV1]] = Field(..., alias="sharedResources")
|
|
180
126
|
cluster: ClusterV1 = Field(..., alias="cluster")
|
|
181
127
|
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Generated by qenerate plugin=pydantic_v2. 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
|
+
ConfigDict,
|
|
16
|
+
Field,
|
|
17
|
+
Json,
|
|
18
|
+
)
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
class ConfiguredBaseModel(BaseModel):
|
|
22
|
+
model_config = ConfigDict(
|
|
23
|
+
extra='forbid'
|
|
24
|
+
)
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
class VaultSecretV1(ConfiguredBaseModel):
|
|
28
|
+
...
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
class VaultSecretV1_VaultSecretV1(VaultSecretV1):
|
|
32
|
+
path: str = Field(..., alias="path")
|
|
33
|
+
field: str = Field(..., alias="field")
|
|
34
|
+
version: Optional[int] = Field(..., alias="version")
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
class OpenshiftResourceRhcsCert(ConfiguredBaseModel):
|
|
38
|
+
secret_name: str = Field(..., alias="secret_name")
|
|
39
|
+
service_account_name: str = Field(..., alias="service_account_name")
|
|
40
|
+
service_account_password: Union[VaultSecretV1_VaultSecretV1, VaultSecretV1] = Field(..., alias="service_account_password")
|
|
41
|
+
auto_renew_threshold_days: Optional[int] = Field(..., alias="auto_renew_threshold_days")
|
|
42
|
+
certificate_format: Optional[str] = Field(..., alias="certificate_format")
|
|
43
|
+
annotations: Optional[Json] = Field(..., alias="annotations")
|
|
@@ -243,6 +243,7 @@ query TerraformResourcesNamespaces {
|
|
|
243
243
|
defaults
|
|
244
244
|
output_resource_name
|
|
245
245
|
storage_class
|
|
246
|
+
bucket_policy
|
|
246
247
|
annotations
|
|
247
248
|
}
|
|
248
249
|
... on NamespaceTerraformResourceS3SQS_v1 {
|
|
@@ -299,6 +300,7 @@ query TerraformResourcesNamespaces {
|
|
|
299
300
|
identifier
|
|
300
301
|
defaults
|
|
301
302
|
es_identifier
|
|
303
|
+
policy
|
|
302
304
|
output_resource_name
|
|
303
305
|
annotations
|
|
304
306
|
}
|
|
@@ -774,6 +776,7 @@ class NamespaceTerraformResourceS3CloudFrontV1(NamespaceTerraformResourceAWSV1):
|
|
|
774
776
|
defaults: str = Field(..., alias="defaults")
|
|
775
777
|
output_resource_name: Optional[str] = Field(..., alias="output_resource_name")
|
|
776
778
|
storage_class: Optional[str] = Field(..., alias="storage_class")
|
|
779
|
+
bucket_policy: Optional[str] = Field(..., alias="bucket_policy")
|
|
777
780
|
annotations: Optional[str] = Field(..., alias="annotations")
|
|
778
781
|
|
|
779
782
|
|
|
@@ -836,6 +839,7 @@ class NamespaceTerraformResourceKinesisV1(NamespaceTerraformResourceAWSV1):
|
|
|
836
839
|
identifier: str = Field(..., alias="identifier")
|
|
837
840
|
defaults: str = Field(..., alias="defaults")
|
|
838
841
|
es_identifier: Optional[str] = Field(..., alias="es_identifier")
|
|
842
|
+
policy: Optional[str] = Field(..., alias="policy")
|
|
839
843
|
output_resource_name: Optional[str] = Field(..., alias="output_resource_name")
|
|
840
844
|
annotations: Optional[str] = Field(..., alias="annotations")
|
|
841
845
|
|
|
@@ -1100,7 +1104,7 @@ class NamespaceTerraformResourceMskV1(NamespaceTerraformResourceAWSV1):
|
|
|
1100
1104
|
|
|
1101
1105
|
|
|
1102
1106
|
class NamespaceTerraformProviderResourceAWSV1(NamespaceExternalResourceV1):
|
|
1103
|
-
resources: list[Union[NamespaceTerraformResourceRDSV1, NamespaceTerraformResourceALBV1, NamespaceTerraformResourceRosaAuthenticatorV1, NamespaceTerraformResourceRoleV1, NamespaceTerraformResourceS3V1, NamespaceTerraformResourceASGV1, NamespaceTerraformResourceRDSProxyV1, NamespaceTerraformResourceElastiCacheV1, NamespaceTerraformResourceSNSTopicV1, NamespaceTerraformResourceCloudWatchV1, NamespaceTerraformResourceServiceAccountV1, NamespaceTerraformResourceS3SQSV1, NamespaceTerraformResourceKMSV1, NamespaceTerraformResourceRosaAuthenticatorVPCEV1, NamespaceTerraformResourceMskV1,
|
|
1107
|
+
resources: list[Union[NamespaceTerraformResourceRDSV1, NamespaceTerraformResourceALBV1, NamespaceTerraformResourceRosaAuthenticatorV1, NamespaceTerraformResourceRoleV1, NamespaceTerraformResourceS3V1, NamespaceTerraformResourceASGV1, NamespaceTerraformResourceRDSProxyV1, NamespaceTerraformResourceElastiCacheV1, NamespaceTerraformResourceSNSTopicV1, NamespaceTerraformResourceCloudWatchV1, NamespaceTerraformResourceServiceAccountV1, NamespaceTerraformResourceS3CloudFrontV1, NamespaceTerraformResourceS3SQSV1, NamespaceTerraformResourceKMSV1, NamespaceTerraformResourceKinesisV1, NamespaceTerraformResourceRosaAuthenticatorVPCEV1, NamespaceTerraformResourceMskV1, NamespaceTerraformResourceElasticSearchV1, NamespaceTerraformResourceACMV1, NamespaceTerraformResourceSecretsManagerV1, NamespaceTerraformResourceRoute53ZoneV1, NamespaceTerraformResourceSQSV1, NamespaceTerraformResourceDynamoDBV1, NamespaceTerraformResourceECRV1, NamespaceTerraformResourceS3CloudFrontPublicKeyV1, NamespaceTerraformResourceSecretsManagerServiceAccountV1, NamespaceTerraformResourceAWSV1]] = Field(..., alias="resources")
|
|
1104
1108
|
|
|
1105
1109
|
|
|
1106
1110
|
class EnvironmentV1(ConfiguredBaseModel):
|
|
@@ -23,6 +23,7 @@ from reconcile.gql_definitions.vpc_peerings_validator.vpc_peerings_validator_pee
|
|
|
23
23
|
DEFINITION = """
|
|
24
24
|
fragment VpcPeeringsValidatorPeeredCluster on Cluster_v1 {
|
|
25
25
|
name
|
|
26
|
+
allowedToBypassPublicPeeringRestriction
|
|
26
27
|
network {
|
|
27
28
|
vpc
|
|
28
29
|
}
|
|
@@ -35,6 +36,7 @@ fragment VpcPeeringsValidatorPeeredCluster on Cluster_v1 {
|
|
|
35
36
|
query VpcPeeringsValidator {
|
|
36
37
|
clusters: clusters_v1 {
|
|
37
38
|
name
|
|
39
|
+
allowedToBypassPublicPeeringRestriction
|
|
38
40
|
network {
|
|
39
41
|
vpc
|
|
40
42
|
}
|
|
@@ -128,6 +130,7 @@ class ClusterPeeringV1(ConfiguredBaseModel):
|
|
|
128
130
|
|
|
129
131
|
class ClusterV1(ConfiguredBaseModel):
|
|
130
132
|
name: str = Field(..., alias="name")
|
|
133
|
+
allowed_to_bypass_public_peering_restriction: Optional[bool] = Field(..., alias="allowedToBypassPublicPeeringRestriction")
|
|
131
134
|
network: Optional[ClusterNetworkV1] = Field(..., alias="network")
|
|
132
135
|
spec: Optional[ClusterSpecV1] = Field(..., alias="spec")
|
|
133
136
|
internal: Optional[bool] = Field(..., alias="internal")
|