fix: coerce-stopgraceperiodswarm-to-number

This commit is contained in:
Lucas Manchine
2025-09-24 09:54:54 -03:00
parent 2141e4b174
commit 59be1c5941
2 changed files with 10 additions and 3 deletions
+2 -1
View File
@@ -192,7 +192,8 @@ export const mechanizeDockerContainer = async (
})), })),
}, },
UpdateConfig, UpdateConfig,
...(StopGracePeriod && { StopGracePeriod }), ...(StopGracePeriod !== undefined &&
StopGracePeriod !== null && { StopGracePeriod }),
}; };
try { try {
+8 -2
View File
@@ -397,6 +397,11 @@ export const generateConfigContainer = (
stopGracePeriodSwarm, stopGracePeriodSwarm,
} = application; } = application;
const sanitizedStopGracePeriodSwarm =
typeof stopGracePeriodSwarm === "bigint"
? Number(stopGracePeriodSwarm)
: stopGracePeriodSwarm;
const haveMounts = mounts && mounts.length > 0; const haveMounts = mounts && mounts.length > 0;
return { return {
@@ -445,8 +450,9 @@ export const generateConfigContainer = (
Order: "start-first", Order: "start-first",
}, },
}), }),
...(stopGracePeriodSwarm && { ...(sanitizedStopGracePeriodSwarm !== null &&
StopGracePeriod: stopGracePeriodSwarm, sanitizedStopGracePeriodSwarm !== undefined && {
StopGracePeriod: sanitizedStopGracePeriodSwarm,
}), }),
...(networkSwarm ...(networkSwarm
? { ? {