fix: add startup probe for env reuse boot
This commit is contained in:
@@ -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") {
|
||||
|
||||
Reference in New Issue
Block a user