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") {