Update how we handle custom configs

This commit is contained in:
Théophile Diot 2023-06-09 14:19:28 -04:00
parent 6a1ff499c1
commit 94964a910a
No known key found for this signature in database
GPG key ID: E752C80DB72BB014
2 changed files with 11 additions and 1 deletions

View file

@ -178,7 +178,8 @@ class Configurator:
if ret:
config[variable] = value
elif (
not variable.startswith("PYTHON")
"CUSTOM_CONF" not in variable
and not variable.startswith("PYTHON")
and not variable.startswith("KUBERNETES_SERVICE_")
and not variable.startswith("KUBERNETES_PORT_")
and not variable.startswith("SVC_")

View file

@ -54,6 +54,9 @@ def get_instance_configs_and_apis(instance: Any, db, _type="Docker"):
),
}
)
logger.info(
f"Found custom conf env var {'for service ' + custom_conf[0] if custom_conf[0] else 'without service'} with type {custom_conf[1]} and name {custom_conf[2]}"
)
else:
tmp_config[splitted[0]] = splitted[1]
@ -217,6 +220,9 @@ if __name__ == "__main__":
),
}
)
logger.info(
f"Found custom conf env var {'for service ' + custom_conf[0] if custom_conf[0] else 'without service'} with type {custom_conf[1]} and name {custom_conf[2]}"
)
configs_path = join(sep, "etc", "bunkerweb", "configs")
root_dirs = listdir(configs_path)
for root, dirs, files in walk(configs_path):
@ -270,6 +276,9 @@ if __name__ == "__main__":
),
}
)
logger.info(
f"Found custom conf env var {'for service ' + custom_conf[0] if custom_conf[0] else 'without service'} with type {custom_conf[1]} and name {custom_conf[2]}"
)
else:
tmp_config[splitted[0]] = splitted[1]