Configurator: make sure all config values have defaults set before hand
This commit is contained in:
parent
7998338b3b
commit
30b8d7b090
|
@ -719,7 +719,11 @@ class NixConfigurator(ConfiguratorBase):
|
||||||
projects = [p for p in projects if self.github.topic in p.topics]
|
projects = [p for p in projects if self.github.topic in p.topics]
|
||||||
worker_config = json.loads(read_secret_file(self.nix_workers_secret_name))
|
worker_config = json.loads(read_secret_file(self.nix_workers_secret_name))
|
||||||
worker_names = []
|
worker_names = []
|
||||||
config["workers"] = config.get("workers", [])
|
|
||||||
|
config.setdefault("projects", [])
|
||||||
|
config.setdefault("secretsProviders", [])
|
||||||
|
config.setdefault("www", {})
|
||||||
|
|
||||||
for item in worker_config:
|
for item in worker_config:
|
||||||
cores = item.get("cores", 0)
|
cores = item.get("cores", 0)
|
||||||
for i in range(cores):
|
for i in range(cores):
|
||||||
|
@ -727,8 +731,6 @@ class NixConfigurator(ConfiguratorBase):
|
||||||
config["workers"].append(worker.Worker(worker_name, item["pass"]))
|
config["workers"].append(worker.Worker(worker_name, item["pass"]))
|
||||||
worker_names.append(worker_name)
|
worker_names.append(worker_name)
|
||||||
|
|
||||||
config["projects"] = config.get("projects", [])
|
|
||||||
|
|
||||||
webhook_secret = read_secret_file(self.github.webhook_secret_name)
|
webhook_secret = read_secret_file(self.github.webhook_secret_name)
|
||||||
|
|
||||||
for project in projects:
|
for project in projects:
|
||||||
|
@ -775,7 +777,6 @@ class NixConfigurator(ConfiguratorBase):
|
||||||
),
|
),
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
config["services"] = config.get("services", [])
|
|
||||||
config["services"].append(
|
config["services"].append(
|
||||||
reporters.GitHubStatusPush(
|
reporters.GitHubStatusPush(
|
||||||
token=self.github.token(),
|
token=self.github.token(),
|
||||||
|
@ -788,9 +789,7 @@ class NixConfigurator(ConfiguratorBase):
|
||||||
systemd_secrets = secrets.SecretInAFile(
|
systemd_secrets = secrets.SecretInAFile(
|
||||||
dirname=os.environ["CREDENTIALS_DIRECTORY"]
|
dirname=os.environ["CREDENTIALS_DIRECTORY"]
|
||||||
)
|
)
|
||||||
config["secretsProviders"] = config.get("secretsProviders", [])
|
|
||||||
config["secretsProviders"].append(systemd_secrets)
|
config["secretsProviders"].append(systemd_secrets)
|
||||||
config["www"] = config.get("www", {})
|
|
||||||
config["www"]["change_hook_dialects"] = config["www"].get(
|
config["www"]["change_hook_dialects"] = config["www"].get(
|
||||||
"change_hook_dialects", {}
|
"change_hook_dialects", {}
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in a new issue