qontract-reconcile 0.10.1rc902__py3-none-any.whl → 0.10.1rc904__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.1rc902
3
+ Version: 0.10.1rc904
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
@@ -10,7 +10,7 @@ reconcile/aws_iam_password_reset.py,sha256=q96mwr2KeEQ5bpNniGlgIMZTxiuLSodcYfX-t
10
10
  reconcile/aws_support_cases_sos.py,sha256=Jk6_XjDeJSYxgRGqcEAOcynt9qJF2r5HPIPcSKmoBv8,2974
11
11
  reconcile/blackbox_exporter_endpoint_monitoring.py,sha256=O1wFp52EyF538c6txaWBs8eMtUIy19gyHZ6VzJ6QXS8,3512
12
12
  reconcile/checkpoint.py,sha256=_JhMxrye5BgkRMxWYuf7Upli6XayPINKSsuo3ynHTRc,5010
13
- reconcile/cli.py,sha256=YHpIxOaOuRlpBCXtlbiJR2fRjAMK0_4vJULYnRO9CS4,105636
13
+ reconcile/cli.py,sha256=W4lRKuz6Z_EHXLf-mQLb3mVdcAr23H4JrY-R8UUPBbs,105862
14
14
  reconcile/closedbox_endpoint_monitoring_base.py,sha256=rLh16BOlBOxTmJ8Si3wWyyEpmMlhh4Znx1Gc36qsmOc,4865
15
15
  reconcile/cluster_deployment_mapper.py,sha256=5gumAaRCcFXsabUJ1dnuUy9WrP_FEEM5JnOnE8ch9sE,2326
16
16
  reconcile/dashdotdb_base.py,sha256=4gJ_VXOOPXPNrJIkSlOr8N1PD60ciZZqSBobNPhXvUA,4768
@@ -75,7 +75,7 @@ reconcile/openshift_resources.py,sha256=I2nO_C37mG3rfyGrd4cGwN3mVseVGuTAHAyhFzLy
75
75
  reconcile/openshift_resources_base.py,sha256=QpV8PC6jG472fR2CMtSKrWL7aAVjoOZskZZYwMQkgFc,40661
76
76
  reconcile/openshift_rolebindings.py,sha256=LlImloBisEqzc36jaatic-TeM3hzqMEfxogF-dM4Yhw,6599
77
77
  reconcile/openshift_routes.py,sha256=fXvuPSjcjVw1X3j2EQvUAdbOepmIFdKk-M3qP8QzPiw,1075
78
- reconcile/openshift_saas_deploy.py,sha256=6cSjHCxKw_Ykg9EWmRbQYANDx2XfrfaCNjK7A3z3bv0,12733
78
+ reconcile/openshift_saas_deploy.py,sha256=b6Og_SlQ-ptYvTBNycK4Z5yP9bbvMXiY39R90TfUfZU,12728
79
79
  reconcile/openshift_saas_deploy_change_tester.py,sha256=FfXrx_JloAlWeJVsJLIQPqFQ7OoBkaB2TgJJXlNZNCM,8796
80
80
  reconcile/openshift_saas_deploy_trigger_base.py,sha256=XQq4Y36p3NLlCKTDQ8MqJheckxE40TJKD_mJDV8bseg,14008
81
81
  reconcile/openshift_saas_deploy_trigger_cleaner.py,sha256=roLyVAVntaQptKaZbnN1LyLvCA8fyvqELfjU6M8xfeY,3511
@@ -463,7 +463,7 @@ reconcile/templates/jira-checkpoint-missinginfo.j2,sha256=c_Vvg-lEENsB3tgxm9B6Y9
463
463
  reconcile/templates/rosa-classic-cluster-creation.sh.j2,sha256=0UHfYtXRVJqP07VJQx456cRI6EbZNBgamtP_8nb4WPY,2353
464
464
  reconcile/templates/rosa-hcp-cluster-creation.sh.j2,sha256=O7Bf3WQIJhsZoEqaYA0wRktUO4yXXCb4BQkuvvp-C80,2385
465
465
  reconcile/templating/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
466
- reconcile/templating/renderer.py,sha256=nras4EkJeyMwJ86R4FB0xGX0TcLfjYxT4bTuA3Glfx0,11773
466
+ reconcile/templating/renderer.py,sha256=VQVsQxMjKfftpsgzpd1jJ-bhrsgi8zjDYXYzMfI4vZA,12104
467
467
  reconcile/templating/validator.py,sha256=L_5kvY1LJTNQUmhPZZoB62NBiTKFIjlia0j6jZGdvh8,4660
468
468
  reconcile/templating/lib/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
469
469
  reconcile/templating/lib/merge_request_manager.py,sha256=4oe3EwQOP7CZSraocivbRzzOuVb0ooElaUS2_DGsF50,5603
@@ -524,7 +524,7 @@ reconcile/test/test_openshift_namespace_labels.py,sha256=i4S5QJFxMRjLkwi3iO6A-uh
524
524
  reconcile/test/test_openshift_namespaces.py,sha256=HmRnCE5EnFt3MYceVEFHmk8wWRtCrxu2AFGFkY9pdyA,9214
525
525
  reconcile/test/test_openshift_resource.py,sha256=lbTf48jX1q6rGnRiA5pPvfU0uPfY8zhNylMtryn0sLI,12995
526
526
  reconcile/test/test_openshift_resources_base.py,sha256=LtlR9x3o7KkSEw0JN0fZhinFeAAxBAQlB_9PpBnKwOM,14353
527
- reconcile/test/test_openshift_saas_deploy.py,sha256=X0cv-f6YoAz-42UamPPFgZROirkzuBBJMiQEYZU_rKA,6001
527
+ reconcile/test/test_openshift_saas_deploy.py,sha256=3QXMrN9dXIiR0JktVDNQ7yJSexMTjZLb1tbRrB3-7uU,5991
528
528
  reconcile/test/test_openshift_saas_deploy_change_tester.py,sha256=1yVe54Hx9YdVjn6qdnKge5Sa_s732c-8uZqCnuT1gGI,12871
529
529
  reconcile/test/test_openshift_saas_deploy_trigger_cleaner.py,sha256=UQx1iJ21rsMa2whG-rtUIuTXbUzc0Ngr7jRLKXZCCCI,2838
530
530
  reconcile/test/test_openshift_tekton_resources.py,sha256=RtRWsdm51S13OSkENC9nY_rOH0QELSCaO5tjF0XqIDI,11222
@@ -844,8 +844,8 @@ tools/test/test_qontract_cli.py,sha256=_D61RFGAN5x44CY1tYbouhlGXXABwYfxKSWSQx3Jr
844
844
  tools/test/test_saas_promotion_state.py,sha256=dy4kkSSAQ7bC0Xp2CociETGN-2aABEfL6FU5D9Jl00Y,6056
845
845
  tools/test/test_sd_app_sre_alert_report.py,sha256=v363r9zM7__0kR5K6mvJoGFcM9BvE33fWAayrqkpojA,2116
846
846
  tools/test/test_sre_checkpoints.py,sha256=SKqPPTl9ua0RFdSSofnoQX-JZE6dFLO3LRhfQzqtfh8,2607
847
- qontract_reconcile-0.10.1rc902.dist-info/METADATA,sha256=VazQRyxvDhiRQ2DbTRuo0UEhfH18pdcyVT00AIctC1I,2273
848
- qontract_reconcile-0.10.1rc902.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
849
- qontract_reconcile-0.10.1rc902.dist-info/entry_points.txt,sha256=GKQqCl2j2X1BJQ69een6rHcR26PmnxnONLNOQB-nRjY,491
850
- qontract_reconcile-0.10.1rc902.dist-info/top_level.txt,sha256=l5ISPoXzt0SdR4jVdkfa7RPSKNc8zAHYWAnR-Dw8Ey8,24
851
- qontract_reconcile-0.10.1rc902.dist-info/RECORD,,
847
+ qontract_reconcile-0.10.1rc904.dist-info/METADATA,sha256=35nxCfRZyg7rbU2UR9f8dh3HN9mqEceMI2fm9FLHHHM,2273
848
+ qontract_reconcile-0.10.1rc904.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
849
+ qontract_reconcile-0.10.1rc904.dist-info/entry_points.txt,sha256=GKQqCl2j2X1BJQ69een6rHcR26PmnxnONLNOQB-nRjY,491
850
+ qontract_reconcile-0.10.1rc904.dist-info/top_level.txt,sha256=l5ISPoXzt0SdR4jVdkfa7RPSKNc8zAHYWAnR-Dw8Ey8,24
851
+ qontract_reconcile-0.10.1rc904.dist-info/RECORD,,
reconcile/cli.py CHANGED
@@ -2083,8 +2083,15 @@ def template_validator(ctx):
2083
2083
  help="Path to a folder app-interface repo should be cloned to. Use this for regular integration run.",
2084
2084
  default=False,
2085
2085
  )
2086
+ @click.option(
2087
+ "--template-collection-name",
2088
+ help="specific template collection name to render",
2089
+ required=False,
2090
+ )
2086
2091
  @click.pass_context
2087
- def template_renderer(ctx, app_interface_data_path, clone_repo):
2092
+ def template_renderer(
2093
+ ctx, app_interface_data_path, clone_repo, template_collection_name
2094
+ ):
2088
2095
  from reconcile.templating.renderer import (
2089
2096
  TemplateRendererIntegration,
2090
2097
  TemplateRendererIntegrationParams,
@@ -2095,6 +2102,7 @@ def template_renderer(ctx, app_interface_data_path, clone_repo):
2095
2102
  TemplateRendererIntegrationParams(
2096
2103
  app_interface_data_path=app_interface_data_path,
2097
2104
  clone_repo=clone_repo,
2105
+ template_collection_name=template_collection_name,
2098
2106
  )
2099
2107
  ),
2100
2108
  ctx=ctx.obj,
@@ -55,7 +55,7 @@ def compose_console_url(saas_file: SaasFile, env_name: str) -> str:
55
55
 
56
56
  return (
57
57
  f"{saas_file.pipelines_provider.namespace.cluster.console_url}/k8s/ns/"
58
- f"{saas_file.pipelines_provider.namespace.name}/tekton.dev~v1beta1~Pipeline/"
58
+ f"{saas_file.pipelines_provider.namespace.name}/tekton.dev~v1~Pipeline/"
59
59
  f"{pipeline_name}/Runs?name={tkn_name}"
60
60
  )
61
61
 
@@ -46,11 +46,14 @@ APP_INTERFACE_PATH_SEPERATOR = "/"
46
46
 
47
47
 
48
48
  def get_template_collections(
49
- query_func: Callable | None = None,
49
+ query_func: Callable | None = None, template_collection_name: str | None = None
50
50
  ) -> list[TemplateCollectionV1]:
51
+ variables: dict[str, Any] = {"filter": {}}
52
+ if template_collection_name:
53
+ variables["filter"]["name"] = template_collection_name
51
54
  if not query_func:
52
55
  query_func = gql.get_api().query
53
- return query(query_func).template_collection_v1 or []
56
+ return query(query_func, variables=variables).template_collection_v1 or []
54
57
 
55
58
 
56
59
  class FilePersistence(ABC):
@@ -193,6 +196,7 @@ def calc_template_hash(c: TemplateCollectionV1, variables: dict[str, Any]) -> st
193
196
  class TemplateRendererIntegrationParams(PydanticRunParams):
194
197
  clone_repo: bool = False
195
198
  app_interface_data_path: str | None
199
+ template_collection_name: str | None
196
200
 
197
201
 
198
202
  def join_path(base: str, sub: str) -> str:
@@ -284,8 +288,9 @@ class TemplateRendererIntegration(QontractReconcileIntegration):
284
288
  ruamel_instance: yaml.YAML,
285
289
  ) -> None:
286
290
  gql_no_validation = init_from_config(validate_schemas=False)
287
-
288
- for c in get_template_collections():
291
+ for c in get_template_collections(
292
+ template_collection_name=self.params.template_collection_name
293
+ ):
289
294
  for_each_items: list[dict[str, Any]] = [{}]
290
295
  if c.for_each and c.for_each.items:
291
296
  for_each_items = c.for_each.items
@@ -59,7 +59,7 @@ def test_compose_console_url(
59
59
 
60
60
  assert (
61
61
  url
62
- == "https://console.url/k8s/ns/namespace_name/tekton.dev~v1beta1~Pipeline/o-saas-deploy-saas_name/"
62
+ == "https://console.url/k8s/ns/namespace_name/tekton.dev~v1~Pipeline/o-saas-deploy-saas_name/"
63
63
  "Runs?name=saas_name-production"
64
64
  )
65
65
 
@@ -75,7 +75,7 @@ def test_compose_console_url_with_medium_saas_name(
75
75
 
76
76
  expected_run_name = f"{saas_name}-{env_name}"[:UNIQUE_SAAS_FILE_ENV_COMBO_LEN]
77
77
  assert (
78
- url == "https://console.url/k8s/ns/namespace_name/tekton.dev~v1beta1~Pipeline/"
78
+ url == "https://console.url/k8s/ns/namespace_name/tekton.dev~v1~Pipeline/"
79
79
  "o-saas-deploy-saas-openshift-cert-manager-routes/"
80
80
  f"Runs?name={expected_run_name}"
81
81
  )