File tree Expand file tree Collapse file tree 2 files changed +7
-5
lines changed
Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ class KubernetesPods {
3434
3535 let containerExitCode : number | undefined ;
3636 let containerSucceeded = false ;
37-
37+
3838 if ( containerStatuses . length > 0 ) {
3939 containerStatuses . forEach ( ( cs , idx ) => {
4040 if ( cs . state ?. waiting ) {
@@ -64,7 +64,7 @@ class KubernetesPods {
6464 // Check if only PreStopHook failed but container succeeded
6565 const hasPreStopHookFailure = events . some ( ( e ) => e . reason === 'FailedPreStopHook' ) ;
6666 const wasKilled = events . some ( ( e ) => e . reason === 'Killing' ) ;
67-
67+
6868 // If container succeeded (exit code 0), PreStopHook failure is non-critical
6969 // Also check if pod was killed but container might have succeeded
7070 if ( containerSucceeded && containerExitCode === 0 ) {
@@ -82,7 +82,7 @@ class KubernetesPods {
8282 // Don't throw error - container succeeded, PreStopHook failure is non-critical
8383 return false ; // Pod is not running, but we don't treat it as a failure
8484 }
85-
85+
8686 // If pod was killed and we have PreStopHook failure but no container status yet, wait a bit
8787 // The container might have succeeded but status hasn't been updated yet
8888 if ( wasKilled && hasPreStopHookFailure && containerExitCode === undefined ) {
Original file line number Diff line number Diff line change @@ -46,10 +46,12 @@ export class CustomWorkflow {
4646 } catch ( error : any ) {
4747 const allowFailure = step . allowFailure === true ;
4848 const stepName = step . name || step . image || 'unknown' ;
49-
49+
5050 if ( allowFailure ) {
5151 CloudRunnerLogger . logWarning (
52- `Hook container "${ stepName } " failed but allowFailure is true. Continuing build. Error: ${ error ?. message || error } ` ,
52+ `Hook container "${ stepName } " failed but allowFailure is true. Continuing build. Error: ${
53+ error ?. message || error
54+ } `,
5355 ) ;
5456 // Continue to next step
5557 } else {
You can’t perform that action at this time.
0 commit comments