From 85643818154914842bce7c4e8253a5f84815008b Mon Sep 17 00:00:00 2001 From: Tsu-ba-me Date: Fri, 15 Dec 2023 14:34:43 -0500 Subject: [PATCH] fix(striker-ui-api): make ipmi address optional --- .../request_handlers/manifest/buildManifest.ts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/striker-ui-api/src/lib/request_handlers/manifest/buildManifest.ts b/striker-ui-api/src/lib/request_handlers/manifest/buildManifest.ts index 6e5b7a35..bca9f27b 100644 --- a/striker-ui-api/src/lib/request_handlers/manifest/buildManifest.ts +++ b/striker-ui-api/src/lib/request_handlers/manifest/buildManifest.ts @@ -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( ({