autoconf - fix global custom configs not supported in k8s/swarm mode

This commit is contained in:
bunkerity 2023-04-04 14:30:14 +02:00
parent eee03c4ae1
commit f6ed21b3b7
2 changed files with 9 additions and 3 deletions

View File

@ -54,14 +54,19 @@ class Config(ConfigCaller):
custom_configs = []
for config_type in self.__configs:
for file, data in self.__configs[config_type].items():
exploded = file.split("/")
site = None
name = file
if "/" in file :
exploded = file.split("/")
site = exploded[0]
name = exploded[1]
custom_configs.append(
{
"value": data,
"exploded": [
exploded[0],
site,
config_type,
exploded[1].replace(".conf", ""),
name.replace(".conf", ""),
],
}
)

View File

@ -98,6 +98,7 @@ class SwarmController(Controller, ConfigCaller):
not config.name
or not config.attrs
or not config.attrs.get("Spec", {}).get("Labels", {})
or not config.attrs.get("Spec", {}).get("Data", {})
):
continue