fix(striker-ui-api): make ipmi address optional

This commit is contained in:
Tsu-ba-me 2023-12-15 14:34:43 -05:00
parent 7b7d79d50f
commit 8564381815

View File

@ -173,17 +173,17 @@ export const buildManifest = async (
`Host number must be an integer; got [${hostNumber}]`,
);
assert(
REP_IPV4.test(ipmiIp),
`IPMI IP of ${hostId} must be an IPv4; got [${ipmiIp}]`,
);
if (ipmiIp) {
assert(
REP_IPV4.test(ipmiIp),
`IPMI IP of ${hostId} must be an IPv4; got [${ipmiIp}]`,
);
hosts[`${hostId}_ipmi_ip`] = ipmiIp;
}
assert.ok(networks, `Host networks is required`);
const ipmiIpKey = `${hostId}_ipmi_ip`;
hosts[ipmiIpKey] = ipmiIp;
try {
Object.values(networks).forEach(
({