qontract-reconcile 0.10.2.dev250__py3-none-any.whl → 0.10.2.dev252__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.dev250
3
+ Version: 0.10.2.dev252
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
@@ -130,8 +130,6 @@ OpenShift templates can be found [here](/openshift/qontract-reconcile.yaml). In
130
130
  RHIDP.
131
131
  cluster-deployment-mapper Maps ClusterDeployment resources to Cluster
132
132
  IDs.
133
- dashdotdb-cso Collects the ImageManifestVuln CRs from all
134
- the clusters and posts them to Dashdotdb.
135
133
  dashdotdb-dora Collects dora metrics.
136
134
  dashdotdb-dvo Collects the DeploymentValidations from all
137
135
  the clusters and posts them to Dashdotdb.
@@ -8,11 +8,10 @@ reconcile/aws_iam_password_reset.py,sha256=O0JX2N5kNRKs3u2xzu4NNrI6p0ag5JWy3MTsv
8
8
  reconcile/aws_support_cases_sos.py,sha256=PDhilxQ4TBxVnxUPIUdTbKEaNUI0wzPiEsB91oHT2fY,3384
9
9
  reconcile/blackbox_exporter_endpoint_monitoring.py,sha256=O1wFp52EyF538c6txaWBs8eMtUIy19gyHZ6VzJ6QXS8,3512
10
10
  reconcile/checkpoint.py,sha256=gjtS8g6KIyKFYlHMSZjAqDUOlVh83nh4go-9yNrhWZU,5016
11
- reconcile/cli.py,sha256=BETiU1ewxtown2t7x-h9xlEwSOWL60nFnoV-1Zg_rm4,112510
11
+ reconcile/cli.py,sha256=fhy651W2bc_ojlmBkAjnr7BmwO733wawu_Cqy54Gg4s,112159
12
12
  reconcile/closedbox_endpoint_monitoring_base.py,sha256=al7m8EgnnYx90rY1REryW3byN_ItfJfAzEeLtjbCfi0,4921
13
13
  reconcile/cluster_deployment_mapper.py,sha256=5gumAaRCcFXsabUJ1dnuUy9WrP_FEEM5JnOnE8ch9sE,2326
14
14
  reconcile/dashdotdb_base.py,sha256=83ZWIf5JJk3P_D69y2TmXRcQr6ELJGlv10OM0h7fJVs,4767
15
- reconcile/dashdotdb_cso.py,sha256=QRK0YfIqO4rehs8btD3l_GXIO2ZIycTQEKEthBdB0xA,3639
16
15
  reconcile/dashdotdb_dora.py,sha256=UI83R8VsrX3vd2ocBakQDKPNE5Ym2a8pnAGUhfkDeR0,17771
17
16
  reconcile/dashdotdb_dvo.py,sha256=lCkZ0iby6HrNQb-3kYb6xrt8wCjVUZYxKzz9SiStfHU,8946
18
17
  reconcile/dashdotdb_slo.py,sha256=TvKdMOtUZcZP9QydcUJMKh0zURHgOMN_RTpQpCkD1Z8,3960
@@ -797,7 +796,7 @@ tools/saas_promotion_state/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJ
797
796
  tools/saas_promotion_state/saas_promotion_state.py,sha256=UfwwRLS5Ya4_Nh1w5n1dvoYtchQvYE9yj1VANt2IKqI,3925
798
797
  tools/sre_checkpoints/__init__.py,sha256=CDaDaywJnmRCLyl_NCcvxi-Zc0hTi_3OdwKiFOyS39I,145
799
798
  tools/sre_checkpoints/util.py,sha256=zEDbGr18ZeHNQwW8pUsr2JRjuXIPz--WAGJxZo9sv_Y,894
800
- qontract_reconcile-0.10.2.dev250.dist-info/METADATA,sha256=ewrKWesKxflh7TnhSAPNX47CvKcNlbRAAKLSbK4cIpo,23974
801
- qontract_reconcile-0.10.2.dev250.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
802
- qontract_reconcile-0.10.2.dev250.dist-info/entry_points.txt,sha256=5i9l54La3vQrDLAdwDKQWC0iG4sV9RRfOb1BpvzOWLc,698
803
- qontract_reconcile-0.10.2.dev250.dist-info/RECORD,,
799
+ qontract_reconcile-0.10.2.dev252.dist-info/METADATA,sha256=8D_ibM9PJ88BV-ZZpRvjh-qDGhamgB5yjMzgy0WBOn8,23820
800
+ qontract_reconcile-0.10.2.dev252.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
801
+ qontract_reconcile-0.10.2.dev252.dist-info/entry_points.txt,sha256=5i9l54La3vQrDLAdwDKQWC0iG4sV9RRfOb1BpvzOWLc,698
802
+ qontract_reconcile-0.10.2.dev252.dist-info/RECORD,,
reconcile/cli.py CHANGED
@@ -3203,18 +3203,6 @@ def gitlab_fork_compliance(
3203
3203
  )
3204
3204
 
3205
3205
 
3206
- @integration.command(
3207
- short_help="Collects the ImageManifestVuln CRs from all the clusters "
3208
- "and posts them to Dashdotdb."
3209
- )
3210
- @threaded(default=2)
3211
- @click.pass_context
3212
- def dashdotdb_cso(ctx: click.Context, thread_pool_size: int) -> None:
3213
- import reconcile.dashdotdb_cso
3214
-
3215
- run_integration(reconcile.dashdotdb_cso, ctx, thread_pool_size)
3216
-
3217
-
3218
3206
  @integration.command(
3219
3207
  short_help="Collects the DeploymentValidations from all the clusters "
3220
3208
  "and posts them to Dashdotdb."
@@ -1,117 +0,0 @@
1
- from typing import Any
2
-
3
- import requests
4
- from sretoolbox.utils import threaded
5
-
6
- from reconcile.dashdotdb_base import (
7
- LOG,
8
- DashdotdbBase,
9
- )
10
- from reconcile.gql_definitions.common.clusters import ClusterV1
11
- from reconcile.typed_queries.app_interface_vault_settings import (
12
- get_app_interface_vault_settings,
13
- )
14
- from reconcile.typed_queries.clusters import get_clusters
15
- from reconcile.utils.oc import (
16
- OCLogMsg,
17
- StatusCodeError,
18
- )
19
- from reconcile.utils.oc_map import (
20
- OCMap,
21
- init_oc_map_from_clusters,
22
- )
23
- from reconcile.utils.secret_reader import (
24
- SecretReaderBase,
25
- create_secret_reader,
26
- )
27
-
28
- QONTRACT_INTEGRATION = "dashdotdb-cso"
29
- LOGMARKER = "DDDB_CSO:"
30
-
31
-
32
- class DashdotdbCSO(DashdotdbBase):
33
- def __init__(
34
- self, dry_run: bool, thread_pool_size: int, secret_reader: SecretReaderBase
35
- ) -> None:
36
- super().__init__(
37
- dry_run=dry_run,
38
- thread_pool_size=thread_pool_size,
39
- marker=LOGMARKER,
40
- scope="imagemanifestvuln",
41
- secret_reader=secret_reader,
42
- )
43
-
44
- def _post(self, manifest: dict[Any, Any]) -> requests.Response | None:
45
- if manifest is None:
46
- return None
47
-
48
- cluster = manifest["cluster"]
49
- imagemanifestvuln = manifest["data"]
50
-
51
- response = None
52
-
53
- LOG.info("%s syncing cluster %s", self.logmarker, cluster)
54
-
55
- if self.dry_run:
56
- return response
57
-
58
- for item in imagemanifestvuln["items"]:
59
- endpoint = f"{self.dashdotdb_url}/api/v1/imagemanifestvuln/{cluster}"
60
- response = self._do_post(endpoint, item)
61
- try:
62
- response.raise_for_status()
63
- except requests.exceptions.HTTPError as details:
64
- LOG.error("%s error posting %s - %s", self.logmarker, cluster, details)
65
-
66
- LOG.info("%s cluster %s synced", self.logmarker, cluster)
67
- return response
68
-
69
- @staticmethod
70
- def _get_imagemanifestvuln(cluster: str, oc_map: OCMap) -> dict[str, Any] | None:
71
- LOG.info("%s processing %s", LOGMARKER, cluster)
72
- oc = oc_map.get(cluster)
73
- if isinstance(oc, OCLogMsg):
74
- LOG.log(level=oc.log_level, msg=oc.message)
75
- return None
76
-
77
- try:
78
- imagemanifestvuln = oc.get_all("ImageManifestVuln", all_namespaces=True)
79
- except StatusCodeError:
80
- LOG.info("%s not installed on %s", LOGMARKER, cluster)
81
- return None
82
-
83
- if not imagemanifestvuln:
84
- return None
85
-
86
- return {"cluster": cluster, "data": imagemanifestvuln}
87
-
88
- def run(self) -> None:
89
- clusters: list[ClusterV1] = get_clusters()
90
- oc_map = init_oc_map_from_clusters(
91
- clusters=clusters,
92
- secret_reader=self.secret_reader,
93
- integration=QONTRACT_INTEGRATION,
94
- use_jump_host=True,
95
- thread_pool_size=self.thread_pool_size,
96
- )
97
- manifests = threaded.run(
98
- func=self._get_imagemanifestvuln,
99
- iterable=oc_map.clusters(),
100
- thread_pool_size=self.thread_pool_size,
101
- oc_map=oc_map,
102
- )
103
-
104
- self._get_token()
105
- threaded.run(
106
- func=self._post, iterable=manifests, thread_pool_size=self.thread_pool_size
107
- )
108
- self._close_token()
109
-
110
-
111
- def run(dry_run: bool = False, thread_pool_size: int = 10) -> None:
112
- vault_settings = get_app_interface_vault_settings()
113
- secret_reader = create_secret_reader(use_vault=vault_settings.vault)
114
- dashdotdb_cso = DashdotdbCSO(
115
- dry_run=dry_run, thread_pool_size=thread_pool_size, secret_reader=secret_reader
116
- )
117
- dashdotdb_cso.run()