EOX GitLab Instance

Skip to content
Snippets Groups Projects
Commit 8b350e0f authored by Nikola Jankovic's avatar Nikola Jankovic :computer:
Browse files

updated to work with new template structure

parent 08ef381a
No related branches found
No related tags found
No related merge requests found
Pipeline #18111 passed
......@@ -12,7 +12,7 @@ def render_config(
) -> None:
# get helm data
configmaps = get_helm_data(helm_config_path, file_type="configmap")
env = get_helm_data(helm_config_path, file_type="registrar-deployment", index=True)
env = get_helm_data(helm_config_path, file_type="deployment", index=True)
# extract envs
envs = extract_env_vars(env)
......@@ -38,11 +38,21 @@ def get_helm_data(helm_config_path: str, file_type: str, index: bool = False) ->
if not os.path.isdir(helm_config_path):
raise ValueError(f"{helm_config_path} is not a directory")
files = [
os.path.join(helm_config_path, f)
for f in os.listdir(helm_config_path)
if os.path.isfile(os.path.join(helm_config_path, f)) and file_type in f
]
to_remove = ["redis", "renderer", "database"]
rendered_templates = os.listdir(helm_config_path)
for template in to_remove:
rendered_templates.remove(template)
files = []
for template_dir in rendered_templates:
template_path = os.path.join(helm_config_path, template_dir)
template_path = os.path.join(template_path, "templates")
for f in os.listdir(template_path):
if file_type in f and os.path.isfile(
template_file := os.path.join(template_path, f)
):
files.append(template_file)
if index:
return files[0]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment