From 2c3cb006c0d2865b5d033b4421fe231d768ee99b Mon Sep 17 00:00:00 2001 From: Frostebite Date: Fri, 5 Dec 2025 23:36:23 +0000 Subject: [PATCH] PR feedback --- src/model/cloud-runner/providers/k8s/kubernetes-pods.ts | 6 +++--- src/model/cloud-runner/workflows/custom-workflow.ts | 6 ++++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/model/cloud-runner/providers/k8s/kubernetes-pods.ts b/src/model/cloud-runner/providers/k8s/kubernetes-pods.ts index 94bfcb8e..1f1ff752 100644 --- a/src/model/cloud-runner/providers/k8s/kubernetes-pods.ts +++ b/src/model/cloud-runner/providers/k8s/kubernetes-pods.ts @@ -34,7 +34,7 @@ class KubernetesPods { let containerExitCode: number | undefined; let containerSucceeded = false; - + if (containerStatuses.length > 0) { containerStatuses.forEach((cs, idx) => { if (cs.state?.waiting) { @@ -64,7 +64,7 @@ class KubernetesPods { // Check if only PreStopHook failed but container succeeded const hasPreStopHookFailure = events.some((e) => e.reason === 'FailedPreStopHook'); const wasKilled = events.some((e) => e.reason === 'Killing'); - + // If container succeeded (exit code 0), PreStopHook failure is non-critical // Also check if pod was killed but container might have succeeded if (containerSucceeded && containerExitCode === 0) { @@ -82,7 +82,7 @@ class KubernetesPods { // Don't throw error - container succeeded, PreStopHook failure is non-critical return false; // Pod is not running, but we don't treat it as a failure } - + // If pod was killed and we have PreStopHook failure but no container status yet, wait a bit // The container might have succeeded but status hasn't been updated yet if (wasKilled && hasPreStopHookFailure && containerExitCode === undefined) { diff --git a/src/model/cloud-runner/workflows/custom-workflow.ts b/src/model/cloud-runner/workflows/custom-workflow.ts index 0ab9a18f..26d21997 100644 --- a/src/model/cloud-runner/workflows/custom-workflow.ts +++ b/src/model/cloud-runner/workflows/custom-workflow.ts @@ -46,10 +46,12 @@ export class CustomWorkflow { } catch (error: any) { const allowFailure = step.allowFailure === true; const stepName = step.name || step.image || 'unknown'; - + if (allowFailure) { CloudRunnerLogger.logWarning( - `Hook container "${stepName}" failed but allowFailure is true. Continuing build. Error: ${error?.message || error}`, + `Hook container "${stepName}" failed but allowFailure is true. Continuing build. Error: ${ + error?.message || error + }`, ); // Continue to next step } else {