qontract-reconcile 0.10.1rc551__py3-none-any.whl → 0.10.1rc552__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.
- {qontract_reconcile-0.10.1rc551.dist-info → qontract_reconcile-0.10.1rc552.dist-info}/METADATA +1 -1
- {qontract_reconcile-0.10.1rc551.dist-info → qontract_reconcile-0.10.1rc552.dist-info}/RECORD +7 -7
- reconcile/openshift_resources_base.py +49 -14
- reconcile/utils/terrascript_aws_client.py +15 -8
- {qontract_reconcile-0.10.1rc551.dist-info → qontract_reconcile-0.10.1rc552.dist-info}/WHEEL +0 -0
- {qontract_reconcile-0.10.1rc551.dist-info → qontract_reconcile-0.10.1rc552.dist-info}/entry_points.txt +0 -0
- {qontract_reconcile-0.10.1rc551.dist-info → qontract_reconcile-0.10.1rc552.dist-info}/top_level.txt +0 -0
{qontract_reconcile-0.10.1rc551.dist-info → qontract_reconcile-0.10.1rc552.dist-info}/METADATA
RENAMED
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: qontract-reconcile
|
3
|
-
Version: 0.10.
|
3
|
+
Version: 0.10.1rc552
|
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
|
{qontract_reconcile-0.10.1rc551.dist-info → qontract_reconcile-0.10.1rc552.dist-info}/RECORD
RENAMED
@@ -70,7 +70,7 @@ reconcile/openshift_namespaces.py,sha256=DboMc6t0vXD54lL9ZP9P9fQnCRo2g_0z5FWubtW
|
|
70
70
|
reconcile/openshift_network_policies.py,sha256=_qqv7yj17OM1J8KJPsFmzFZ85gzESJeBocC672z4_WU,4231
|
71
71
|
reconcile/openshift_resourcequotas.py,sha256=yUi56PiOn3inMMfq_x_FEHmaW-reGipzoorjdar372g,2415
|
72
72
|
reconcile/openshift_resources.py,sha256=kwsY5cko7udEKNlhL2oKiKv_5wzEw9wmmwROE016ng8,1400
|
73
|
-
reconcile/openshift_resources_base.py,sha256=
|
73
|
+
reconcile/openshift_resources_base.py,sha256=DpB7DD8SqVrlqaZ6Vvv6WdA92DLRUhKNksum82ZZo_8,46630
|
74
74
|
reconcile/openshift_rolebindings.py,sha256=0sEKajdqVuBSzlagyPbLxtNXQdI2vyabmbIRifs0des,6629
|
75
75
|
reconcile/openshift_routes.py,sha256=fXvuPSjcjVw1X3j2EQvUAdbOepmIFdKk-M3qP8QzPiw,1075
|
76
76
|
reconcile/openshift_saas_deploy.py,sha256=NFiNrk7055vunzzJmI7cVBubFj6JPDlEpJqDwpG_t9g,12706
|
@@ -587,7 +587,7 @@ reconcile/utils/state.py,sha256=SAa6QLHu9lr0yqLCBy2AypNx1IPCJWlrRBrvlzAKsOU,1450
|
|
587
587
|
reconcile/utils/structs.py,sha256=LcbLEg8WxfRqM6nW7NhcWN0YeqF7SQzxOgntmLs1SgY,352
|
588
588
|
reconcile/utils/template.py,sha256=wTvRU4AnAV_o042tD4Mwls2dwWMuk7MKnde3MaCjaYg,331
|
589
589
|
reconcile/utils/terraform_client.py,sha256=_jBriLBwU005bDxWlq7CRByOkVCfiH47oBzB0ArNAY8,31901
|
590
|
-
reconcile/utils/terrascript_aws_client.py,sha256=
|
590
|
+
reconcile/utils/terrascript_aws_client.py,sha256=zrm3naWWuWyJ1qOXlHBQWWi7rg-YUOt84nh1un_PVBE,266588
|
591
591
|
reconcile/utils/three_way_diff_strategy.py,sha256=nyqeQsLCoPI6e16k2CF3b9KNgQLU-rPf5RtfdUfVMwE,4468
|
592
592
|
reconcile/utils/throughput.py,sha256=iP4UWAe2LVhDo69mPPmgo9nQ7RxHD6_GS8MZe-aSiuM,344
|
593
593
|
reconcile/utils/unleash.py,sha256=1D56CsZfE3ShDtN3IErE1T2eeIwNmxhK-yYbCotJ99E,3601
|
@@ -674,8 +674,8 @@ tools/test/test_app_interface_metrics_exporter.py,sha256=SX7qL3D1SIRKFo95FoQztvf
|
|
674
674
|
tools/test/test_qontract_cli.py,sha256=se-YG_YVCWRFrnCPvBVHDBT_59CkbIoEni-4SJa8_MU,2755
|
675
675
|
tools/test/test_sd_app_sre_alert_report.py,sha256=v363r9zM7__0kR5K6mvJoGFcM9BvE33fWAayrqkpojA,2116
|
676
676
|
tools/test/test_sre_checkpoints.py,sha256=SKqPPTl9ua0RFdSSofnoQX-JZE6dFLO3LRhfQzqtfh8,2607
|
677
|
-
qontract_reconcile-0.10.
|
678
|
-
qontract_reconcile-0.10.
|
679
|
-
qontract_reconcile-0.10.
|
680
|
-
qontract_reconcile-0.10.
|
681
|
-
qontract_reconcile-0.10.
|
677
|
+
qontract_reconcile-0.10.1rc552.dist-info/METADATA,sha256=_2z1g2jyE05bW9_2lkZsPw_OHN6ta7gTD4eZni-wgvw,2349
|
678
|
+
qontract_reconcile-0.10.1rc552.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
|
679
|
+
qontract_reconcile-0.10.1rc552.dist-info/entry_points.txt,sha256=rTjAv28I_CHLM8ID3OPqMI_suoQ9s7tFbim4aYjn9kk,376
|
680
|
+
qontract_reconcile-0.10.1rc552.dist-info/top_level.txt,sha256=l5ISPoXzt0SdR4jVdkfa7RPSKNc8zAHYWAnR-Dw8Ey8,24
|
681
|
+
qontract_reconcile-0.10.1rc552.dist-info/RECORD,,
|
@@ -288,27 +288,42 @@ class UnknownTemplateTypeError(Exception):
|
|
288
288
|
|
289
289
|
|
290
290
|
@retry()
|
291
|
-
def lookup_secret(
|
291
|
+
def lookup_secret(
|
292
|
+
path, key, version=None, tvars=None, settings=None, secret_reader=None
|
293
|
+
):
|
292
294
|
if tvars is not None:
|
293
|
-
path = process_jinja2_template(
|
294
|
-
|
295
|
+
path = process_jinja2_template(
|
296
|
+
body=path, vars=tvars, settings=settings, secret_reader=secret_reader
|
297
|
+
)
|
298
|
+
key = process_jinja2_template(
|
299
|
+
body=key, vars=tvars, settings=settings, secret_reader=secret_reader
|
300
|
+
)
|
295
301
|
if version and not isinstance(version, int):
|
296
302
|
version = process_jinja2_template(
|
297
|
-
body=version, vars=tvars, settings=settings
|
303
|
+
body=version, vars=tvars, settings=settings, secret_reader=secret_reader
|
298
304
|
)
|
299
305
|
secret = {"path": path, "field": key, "version": version}
|
300
306
|
try:
|
301
|
-
|
307
|
+
if not secret_reader:
|
308
|
+
secret_reader = SecretReader(settings)
|
302
309
|
return secret_reader.read(secret)
|
303
310
|
except Exception as e:
|
304
311
|
raise FetchSecretError(e)
|
305
312
|
|
306
313
|
|
307
|
-
def lookup_github_file_content(
|
314
|
+
def lookup_github_file_content(
|
315
|
+
repo, path, ref, tvars=None, settings=None, secret_reader=None
|
316
|
+
):
|
308
317
|
if tvars is not None:
|
309
|
-
repo = process_jinja2_template(
|
310
|
-
|
311
|
-
|
318
|
+
repo = process_jinja2_template(
|
319
|
+
body=repo, vars=tvars, settings=settings, secret_reader=secret_reader
|
320
|
+
)
|
321
|
+
path = process_jinja2_template(
|
322
|
+
body=path, vars=tvars, settings=settings, secret_reader=secret_reader
|
323
|
+
)
|
324
|
+
ref = process_jinja2_template(
|
325
|
+
body=ref, vars=tvars, settings=settings, secret_reader=secret_reader
|
326
|
+
)
|
312
327
|
|
313
328
|
gh = init_github()
|
314
329
|
c = gh.get_repo(repo).get_contents(path, ref).decoded_content
|
@@ -435,15 +450,27 @@ def compile_jinja2_template(body, extra_curly: bool = False):
|
|
435
450
|
return jinja_env.from_string(body)
|
436
451
|
|
437
452
|
|
438
|
-
def process_jinja2_template(
|
453
|
+
def process_jinja2_template(
|
454
|
+
body, vars=None, extra_curly: bool = False, settings=None, secret_reader=None
|
455
|
+
):
|
439
456
|
if vars is None:
|
440
457
|
vars = {}
|
441
458
|
vars.update({
|
442
459
|
"vault": lambda p, k, v=None: lookup_secret(
|
443
|
-
path=p,
|
460
|
+
path=p,
|
461
|
+
key=k,
|
462
|
+
version=v,
|
463
|
+
tvars=vars,
|
464
|
+
settings=settings,
|
465
|
+
secret_reader=secret_reader,
|
444
466
|
),
|
445
467
|
"github": lambda u, p, r, v=None: lookup_github_file_content(
|
446
|
-
repo=u,
|
468
|
+
repo=u,
|
469
|
+
path=p,
|
470
|
+
ref=r,
|
471
|
+
tvars=vars,
|
472
|
+
settings=settings,
|
473
|
+
secret_reader=secret_reader,
|
447
474
|
),
|
448
475
|
"urlescape": lambda u, s="/", e=None: urlescape(string=u, safe=s, encoding=e),
|
449
476
|
"urlunescape": lambda u, e=None: urlunescape(string=u, encoding=e),
|
@@ -459,10 +486,18 @@ def process_jinja2_template(body, vars=None, extra_curly: bool = False, settings
|
|
459
486
|
return r
|
460
487
|
|
461
488
|
|
462
|
-
def process_extracurlyjinja2_template(
|
489
|
+
def process_extracurlyjinja2_template(
|
490
|
+
body, vars=None, env=None, settings=None, secret_reader=None
|
491
|
+
):
|
463
492
|
if vars is None:
|
464
493
|
vars = {}
|
465
|
-
return process_jinja2_template(
|
494
|
+
return process_jinja2_template(
|
495
|
+
body,
|
496
|
+
vars=vars,
|
497
|
+
extra_curly=True,
|
498
|
+
settings=settings,
|
499
|
+
secret_reader=secret_reader,
|
500
|
+
)
|
466
501
|
|
467
502
|
|
468
503
|
def check_alertmanager_config(data, path, alertmanager_config_key, decode_base64=False):
|
@@ -181,7 +181,7 @@ from reconcile.utils.password_validator import (
|
|
181
181
|
PasswordPolicy,
|
182
182
|
PasswordValidator,
|
183
183
|
)
|
184
|
-
from reconcile.utils.secret_reader import SecretReader
|
184
|
+
from reconcile.utils.secret_reader import SecretReader, SecretReaderBase
|
185
185
|
from reconcile.utils.terraform import safe_resource_id
|
186
186
|
|
187
187
|
GH_BASE_URL = os.environ.get("GITHUB_API", "https://api.github.com")
|
@@ -368,13 +368,16 @@ class TerrascriptClient: # pylint: disable=too-many-public-methods
|
|
368
368
|
accounts: Iterable[dict[str, Any]],
|
369
369
|
settings: Optional[Mapping[str, Any]] = None,
|
370
370
|
prefetch_resources_by_schemas: Optional[list[str]] = None,
|
371
|
+
secret_reader: Optional[SecretReaderBase] = None,
|
371
372
|
) -> None:
|
372
373
|
self.integration = integration
|
373
374
|
self.integration_prefix = integration_prefix
|
374
|
-
self.settings = settings
|
375
375
|
self.thread_pool_size = thread_pool_size
|
376
376
|
filtered_accounts = self.filter_disabled_accounts(accounts)
|
377
|
-
|
377
|
+
if secret_reader:
|
378
|
+
self.secret_reader = secret_reader
|
379
|
+
else:
|
380
|
+
self.secret_reader = SecretReader(settings=settings)
|
378
381
|
self.configs: dict[str, dict] = {}
|
379
382
|
self.populate_configs(filtered_accounts)
|
380
383
|
self.versions = {a["name"]: a["providerVersion"] for a in filtered_accounts}
|
@@ -601,7 +604,7 @@ class TerrascriptClient: # pylint: disable=too-many-public-methods
|
|
601
604
|
with self.gitlab_lock:
|
602
605
|
if not self.gitlab:
|
603
606
|
instance = queries.get_gitlab_instance()
|
604
|
-
self.gitlab = GitLabApi(instance,
|
607
|
+
self.gitlab = GitLabApi(instance, secret_reader=self.secret_reader)
|
605
608
|
return self.gitlab
|
606
609
|
|
607
610
|
def init_jenkins(self, instance: dict) -> JenkinsApi:
|
@@ -612,7 +615,7 @@ class TerrascriptClient: # pylint: disable=too-many-public-methods
|
|
612
615
|
if not self.jenkins_map.get(instance_name):
|
613
616
|
self.jenkins_map[instance_name] = (
|
614
617
|
JenkinsApi.init_jenkins_from_secret(
|
615
|
-
|
618
|
+
self.secret_reader, instance["token"]
|
616
619
|
)
|
617
620
|
)
|
618
621
|
return self.jenkins_map[instance_name]
|
@@ -4745,7 +4748,9 @@ class TerrascriptClient: # pylint: disable=too-many-public-methods
|
|
4745
4748
|
)
|
4746
4749
|
account["assume_region"] = cluster["spec"]["region"]
|
4747
4750
|
service_name = f"{namespace_info['name']}/{openshift_service}"
|
4748
|
-
with AWSApi(
|
4751
|
+
with AWSApi(
|
4752
|
+
1, [account], secret_reader=self.secret_reader, init_users=False
|
4753
|
+
) as awsapi:
|
4749
4754
|
ips = awsapi.get_alb_network_interface_ips(account, service_name)
|
4750
4755
|
if not ips:
|
4751
4756
|
raise ValueError(
|
@@ -5176,7 +5181,9 @@ class TerrascriptClient: # pylint: disable=too-many-public-methods
|
|
5176
5181
|
|
5177
5182
|
# Get the most recent AMI id
|
5178
5183
|
aws_account = self.accounts[account]
|
5179
|
-
with AWSApi(
|
5184
|
+
with AWSApi(
|
5185
|
+
1, [aws_account], secret_reader=self.secret_reader, init_users=False
|
5186
|
+
) as aws:
|
5180
5187
|
return aws.get_image_id(account, region, tags)
|
5181
5188
|
|
5182
5189
|
def _use_previous_image_id(self, filters: Iterable[Mapping[str, Any]]) -> bool:
|
@@ -5259,7 +5266,7 @@ class TerrascriptClient: # pylint: disable=too-many-public-methods
|
|
5259
5266
|
for c in cloudinit_configs:
|
5260
5267
|
raw = self.get_raw_values(c["content"])
|
5261
5268
|
content = orb.process_extracurlyjinja2_template(
|
5262
|
-
body=raw["content"], vars=vars,
|
5269
|
+
body=raw["content"], vars=vars, secret_reader=self.secret_reader
|
5263
5270
|
)
|
5264
5271
|
# https://www.terraform.io/docs/language/expressions/strings.html#escape-sequences
|
5265
5272
|
content = content.replace("${", "$${")
|
File without changes
|
File without changes
|
{qontract_reconcile-0.10.1rc551.dist-info → qontract_reconcile-0.10.1rc552.dist-info}/top_level.txt
RENAMED
File without changes
|