mirror of
https://gitlab.com/itsulu-odoo/runboat.git
synced 2026-05-30 23:41:27 +00:00
Allow any kubefile to be a jinja template
This is simpler than patching in the kustomization.yaml.jinja
This commit is contained in:
parent
a201dc5798
commit
a1bd1c15e2
1 changed files with 6 additions and 4 deletions
|
|
@ -200,10 +200,12 @@ def _render_kubefiles(
|
||||||
_logger.debug("kubefiles path: %s", kubefiles_path)
|
_logger.debug("kubefiles path: %s", kubefiles_path)
|
||||||
# TODO async copytree, or make this whole _render_kubefiles run_in_executor
|
# TODO async copytree, or make this whole _render_kubefiles run_in_executor
|
||||||
shutil.copytree(kubefiles_path, tmp_path, dirs_exist_ok=True)
|
shutil.copytree(kubefiles_path, tmp_path, dirs_exist_ok=True)
|
||||||
template = Template((tmp_path / "kustomization.yaml.jinja").read_text())
|
for template_path in tmp_path.rglob("*.jinja"):
|
||||||
(tmp_path / "kustomization.yaml").write_text(
|
template = Template(template_path.read_text())
|
||||||
template.render(dict(deployment_vars))
|
template_path.with_suffix("").write_text(
|
||||||
)
|
template.render(dict(deployment_vars))
|
||||||
|
)
|
||||||
|
template_path.unlink()
|
||||||
yield tmp_path
|
yield tmp_path
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue