From 324f9d17cd2a4e20c5aa975a73ca74faf6de82b4 Mon Sep 17 00:00:00 2001 From: Aiden McClelland Date: Wed, 11 Mar 2026 15:13:48 -0600 Subject: [PATCH] fix: use z.union instead of z.intersection for health check schema --- .../Systems/SystemForEmbassy/matchManifest.ts | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/container-runtime/src/Adapters/Systems/SystemForEmbassy/matchManifest.ts b/container-runtime/src/Adapters/Systems/SystemForEmbassy/matchManifest.ts index f3fe101eb..d3a309d18 100644 --- a/container-runtime/src/Adapters/Systems/SystemForEmbassy/matchManifest.ts +++ b/container-runtime/src/Adapters/Systems/SystemForEmbassy/matchManifest.ts @@ -10,6 +10,11 @@ const matchJsProcedure = z.object({ const matchProcedure = z.union([matchDockerProcedure, matchJsProcedure]) export type Procedure = z.infer +const healthCheckFields = { + name: z.string(), + "success-message": z.string().nullable().optional(), +} + const matchAction = z.object({ name: z.string(), description: z.string(), @@ -32,13 +37,10 @@ export const matchManifest = z.object({ .optional(), "health-checks": z.record( z.string(), - z.intersection( - matchProcedure, - z.object({ - name: z.string(), - "success-message": z.string().nullable().optional(), - }), - ), + z.union([ + matchDockerProcedure.extend(healthCheckFields), + matchJsProcedure.extend(healthCheckFields), + ]), ), config: z .object({