qontract-reconcile 0.10.1rc961__py3-none-any.whl → 0.10.1rc963__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.10.1rc961
3
+ Version: 0.10.1rc963
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
@@ -661,7 +661,7 @@ reconcile/utils/gitlab_api.py,sha256=6ZU77wzwYKVbJcuXrG0ZMvAsB-_N9On84LQiT_yZdeE
661
661
  reconcile/utils/gpg.py,sha256=EKG7_fdMv8BMlV5yUdPiqoTx-KrzmVSEAl2sLkaKwWI,1123
662
662
  reconcile/utils/gql.py,sha256=IGhxzBcuebbapDKLseevEThSsxa_eDCPNpo3A4VnOS4,14066
663
663
  reconcile/utils/grouping.py,sha256=vr9SFHZ7bqmHYrvYcEZt-Er3-yQYfAAdq5sHLZVmXPY,456
664
- reconcile/utils/helm.py,sha256=qnXtw3nyKJqobSG4d6PtvulqToqiEGuXK5PbgfwSFHI,1942
664
+ reconcile/utils/helm.py,sha256=d4WFxf6NFcNj0I2YWDvWxN5gK80o2Y12Ve05ky73FCc,2763
665
665
  reconcile/utils/helpers.py,sha256=k9svgFFZG7H5FvHYY0g5jJyvgvh2UDZxf0Ib221teag,1179
666
666
  reconcile/utils/imap_client.py,sha256=PMsX8UjJ2F59fXbbqREjLVdapYWznYTB8svFmpt39qA,1949
667
667
  reconcile/utils/instrumented_wrappers.py,sha256=eVwMoa6FCrYxLv3RML3WpZF9qKVfCTjMxphgVXG03OM,1073
@@ -773,6 +773,7 @@ reconcile/utils/ocm/clusters.py,sha256=Fn4swizm1qq-XiNlIZ9SvahkftWAyNT8hF4kqRBpK
773
773
  reconcile/utils/ocm/identity_providers.py,sha256=dKed09N8iWmn39tI_MpwgVe47x23eLsknGbjMUxtwr4,2175
774
774
  reconcile/utils/ocm/label_sources.py,sha256=ES_5VP4X6gsRxMFZ95WgbwE_HqqIUo_JRjHjdGYw6Ss,1846
775
775
  reconcile/utils/ocm/labels.py,sha256=aCsL5QkRk32hZeJwsSJuCCT9sbojWMn8LL5Zo-aoFb4,5916
776
+ reconcile/utils/ocm/manifests.py,sha256=8kCVwTiaYHyjiKfP2DrkoT9eFxROy_M3rLom_hdsEIU,1193
776
777
  reconcile/utils/ocm/ocm.py,sha256=I5D7e8VxP8mhsi2ifYpKsr8UpbG5Syy8PfVpS6UWkmE,36659
777
778
  reconcile/utils/ocm/products.py,sha256=ZoK-3i4G2DGZRTwCfT_-ymHm2GCan_uImeqQJVJHLMw,25952
778
779
  reconcile/utils/ocm/search_filters.py,sha256=fNrCNJKLgp9x7z5MvlwWHaOhcMEVrEqlm9xdxFU8JgE,14937
@@ -846,8 +847,8 @@ tools/test/test_qontract_cli.py,sha256=_D61RFGAN5x44CY1tYbouhlGXXABwYfxKSWSQx3Jr
846
847
  tools/test/test_saas_promotion_state.py,sha256=dy4kkSSAQ7bC0Xp2CociETGN-2aABEfL6FU5D9Jl00Y,6056
847
848
  tools/test/test_sd_app_sre_alert_report.py,sha256=v363r9zM7__0kR5K6mvJoGFcM9BvE33fWAayrqkpojA,2116
848
849
  tools/test/test_sre_checkpoints.py,sha256=SKqPPTl9ua0RFdSSofnoQX-JZE6dFLO3LRhfQzqtfh8,2607
849
- qontract_reconcile-0.10.1rc961.dist-info/METADATA,sha256=9FJmKwNimHWkAfk06J2Ug8XSxFL8tQcCFMPB0qS-Mic,2262
850
- qontract_reconcile-0.10.1rc961.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
851
- qontract_reconcile-0.10.1rc961.dist-info/entry_points.txt,sha256=GKQqCl2j2X1BJQ69een6rHcR26PmnxnONLNOQB-nRjY,491
852
- qontract_reconcile-0.10.1rc961.dist-info/top_level.txt,sha256=l5ISPoXzt0SdR4jVdkfa7RPSKNc8zAHYWAnR-Dw8Ey8,24
853
- qontract_reconcile-0.10.1rc961.dist-info/RECORD,,
850
+ qontract_reconcile-0.10.1rc963.dist-info/METADATA,sha256=AiGv3ClIB_-Pa6p12xqAjUMwkIZruqlZxurmniRlQas,2262
851
+ qontract_reconcile-0.10.1rc963.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
852
+ qontract_reconcile-0.10.1rc963.dist-info/entry_points.txt,sha256=GKQqCl2j2X1BJQ69een6rHcR26PmnxnONLNOQB-nRjY,491
853
+ qontract_reconcile-0.10.1rc963.dist-info/top_level.txt,sha256=l5ISPoXzt0SdR4jVdkfa7RPSKNc8zAHYWAnR-Dw8Ey8,24
854
+ qontract_reconcile-0.10.1rc963.dist-info/RECORD,,
reconcile/utils/helm.py CHANGED
@@ -1,4 +1,5 @@
1
1
  import json
2
+ import os
2
3
  import tempfile
3
4
  from collections.abc import Iterable, Mapping
4
5
  from subprocess import (
@@ -30,6 +31,26 @@ def do_template(
30
31
  name: str,
31
32
  ) -> str:
32
33
  try:
34
+ with open(os.path.join(path, "Chart.yaml"), encoding="locale") as chart_file:
35
+ chart = yaml.safe_load(chart_file)
36
+ if dependencies := chart.get("dependencies"):
37
+ for dep in dependencies:
38
+ if repo := dep.get("repository"):
39
+ cmd = [
40
+ "helm",
41
+ "repo",
42
+ "add",
43
+ dep["name"],
44
+ repo,
45
+ ]
46
+ run(cmd, capture_output=False, check=True)
47
+ cmd = [
48
+ "helm",
49
+ "dependency",
50
+ "build",
51
+ path,
52
+ ]
53
+ run(cmd, capture_output=False, check=True)
33
54
  with tempfile.NamedTemporaryFile(mode="w+", encoding="locale") as values_file:
34
55
  values_file.write(json.dumps(values, cls=JSONEncoder))
35
56
  values_file.flush()
@@ -0,0 +1,39 @@
1
+ from collections.abc import Generator, Mapping
2
+ from dataclasses import dataclass
3
+ from typing import Any
4
+
5
+ from reconcile.utils.ocm_base_client import OCMBaseClient
6
+
7
+
8
+ @dataclass
9
+ class Manifest:
10
+ def __init__(self, cluster_id: str):
11
+ self.href = f"/api/clusters_mgmt/v1/clusters/{cluster_id}/external_configuration/manifests"
12
+
13
+ href: str
14
+
15
+
16
+ def get_manifests(
17
+ ocm_client: OCMBaseClient, cluster_id: str
18
+ ) -> Generator[dict[str, Any], None, None]:
19
+ manifest = Manifest(cluster_id)
20
+ return ocm_client.get_paginated(api_path=manifest.href)
21
+
22
+
23
+ def get_manifest(ocm_client: OCMBaseClient, cluster_id: str, manifest_id: str) -> Any:
24
+ manifest = Manifest(cluster_id)
25
+ return ocm_client.get(api_path=manifest.href + "/" + manifest_id)
26
+
27
+
28
+ def create_manifest(
29
+ ocm_client: OCMBaseClient, cluster_id: str, manifest_map: Mapping
30
+ ) -> None:
31
+ manifest = Manifest(cluster_id)
32
+ ocm_client.post(api_path=manifest.href, data=manifest_map)
33
+
34
+
35
+ def patch_manifest(
36
+ ocm_client: OCMBaseClient, cluster_id: str, syncset_id: str, manifest_map: Mapping
37
+ ) -> None:
38
+ manifest = Manifest(cluster_id)
39
+ ocm_client.patch(api_path=manifest.href + "/" + syncset_id, data=manifest_map)