From 690494c1ea8d959e7898f190cc9e431a61483d05 Mon Sep 17 00:00:00 2001 From: Codex Agent Date: Sat, 13 Jun 2026 05:32:12 +0800 Subject: [PATCH] fix: add startup probe for env reuse boot --- scripts/gitops-render.mjs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/scripts/gitops-render.mjs b/scripts/gitops-render.mjs index 9a00e0eb..620d4680 100644 --- a/scripts/gitops-render.mjs +++ b/scripts/gitops-render.mjs @@ -511,6 +511,19 @@ function applyEnvReuseBootEnv(container, bootMetadata, { sourceBranch, bootSh = upsertEnv(container.env, "HWLAB_ENVIRONMENT_INPUT_HASH", bootMetadata.environmentInputHash ?? ""); upsertEnv(container.env, "HWLAB_CODE_INPUT_HASH", bootMetadata.codeInputHash ?? ""); upsertEnv(container.env, "HWLAB_IMAGE_DIGEST", bootMetadata.environmentDigest ?? "unknown"); + applyEnvReuseStartupProbe(container); +} + +function applyEnvReuseStartupProbe(container) { + const probe = container.readinessProbe ?? container.livenessProbe; + if (!probe?.httpGet && !probe?.tcpSocket && !probe?.exec) return; + container.startupProbe ??= { + ...cloneJson(probe), + periodSeconds: 10, + timeoutSeconds: Math.max(Number(probe.timeoutSeconds ?? 1), 2), + failureThreshold: 30, + successThreshold: 1 + }; } function useLocalHealthProbe(container, pathValue = "/health") {