fixed syntax healthcheck

This commit is contained in:
Philipp
2026-05-21 10:40:16 +02:00
parent 30e2afdc79
commit 07dbf2edc4
+10 -3
View File
@@ -10,7 +10,14 @@ healthRouter.get('/', async (_req, res) => {
const missing = missingEnvVars();
const checks = {
config: checkValue(!missing.length, missing.length ? `missing: ${missing.join(', ')}` : 'ok'),
commands: await checkCommands(['incus', 'zfs', 'zpool', 'restic', 'udevadm', 'dd']),
commands: await checkCommands({
incus: ['version'],
zfs: ['version'],
zpool: ['version'],
restic: ['version'],
udevadm: ['--version'],
dd: ['--version'],
}),
zfsPool: await checkZfsPool(),
zvol: await checkZvolAccess(),
resticRepository: await checkResticRepository(),
@@ -22,8 +29,8 @@ healthRouter.get('/', async (_req, res) => {
async function checkCommands(commands) {
const results = {};
await Promise.all(commands.map(async (command) => {
results[command] = await checkCommand(command, ['--version']);
await Promise.all(Object.entries(commands).map(async ([command, args]) => {
results[command] = await checkCommand(command, args);
}));
const failed = Object.entries(results).filter(([, result]) => !result.ok);
return {