From af27abe1f7351547dd82fa1151a00898e286d785 Mon Sep 17 00:00:00 2001 From: Katarzyna <45594770+katarzynainit@users.noreply.github.com> Date: Tue, 20 Feb 2024 12:01:11 +0100 Subject: [PATCH] Read logs also from failed child (container job/container action) pod (#135) Co-authored-by: Katarzyna Radkowska --- packages/k8s/src/hooks/run-container-step.ts | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/packages/k8s/src/hooks/run-container-step.ts b/packages/k8s/src/hooks/run-container-step.ts index 12ddd49..9322dc8 100644 --- a/packages/k8s/src/hooks/run-container-step.ts +++ b/packages/k8s/src/hooks/run-container-step.ts @@ -12,10 +12,10 @@ import { } from '../k8s' import { containerVolumes, - PodPhase, + fixArgs, mergeContainerWithOptions, - readExtensionFromFile, - fixArgs + PodPhase, + readExtensionFromFile } from '../k8s/utils' import { JOB_CONTAINER_EXTENSION_NAME, JOB_CONTAINER_NAME } from './constants' @@ -65,7 +65,12 @@ export async function runContainerStep( await waitForPodPhases( podName, - new Set([PodPhase.COMPLETED, PodPhase.RUNNING, PodPhase.SUCCEEDED]), + new Set([ + PodPhase.COMPLETED, + PodPhase.RUNNING, + PodPhase.SUCCEEDED, + PodPhase.FAILED + ]), new Set([PodPhase.PENDING, PodPhase.UNKNOWN]) ) core.debug('Container step is running or complete, pulling logs')