Merge pull request #89 from HideyoshiNakazone/node-selector-via-parameter

Fixes Setup Script
This commit is contained in:
2024-02-18 12:15:36 -03:00
committed by GitHub

View File

@@ -2,18 +2,12 @@ from base64 import b64decode, b64encode
from dotenv import load_dotenv from dotenv import load_dotenv
from envsubst import envsubst from envsubst import envsubst
from pathlib import Path, PosixPath from pathlib import Path, PosixPath
from typing import Generator
import argparse import argparse
import warnings import warnings
import json import json
import os import os
def unpack_list_dict(dl: list[dict]) -> Generator[tuple[str, str], None, None]:
for d in dl:
yield tuple(d.values())
def write_template(template: str, output: str): def write_template(template: str, output: str):
with open(template, 'r') as template,\ with open(template, 'r') as template,\
open(output, 'w') as output: open(output, 'w') as output:
@@ -60,8 +54,8 @@ def configure_templates(environment: str):
{"template": "template/storage/storage.template.yaml", "output": "deployment/storage/storage.yaml"}, {"template": "template/storage/storage.template.yaml", "output": "deployment/storage/storage.yaml"},
] ]
for template, output in unpack_list_dict(MAPPINS): for mapping in MAPPINS:
write_template(template, output) write_template(mapping["template"], mapping["output"])
def validate_backend_secret(secret: str): def validate_backend_secret(secret: str):