pull/524/head
Frostebite 2023-03-25 20:18:06 +00:00
parent 42964bcf5d
commit 6dbd40358e
4 changed files with 22 additions and 3 deletions

11
dist/index.js generated vendored
View File

@ -3342,6 +3342,7 @@ class KubernetesJobSpecFactory {
],
containers: [
{
ttlSecondsAfterFinished: 9999,
name: KubernetesJobSpecFactory.MainContainerName,
image,
command: ['/bin/sh'],
@ -3703,7 +3704,15 @@ class KubernetesTaskRunner {
logs = await cloud_runner_system_1.CloudRunnerSystem.Run(`kubectl logs ${podName}${extraFlags} -f -c ${containerName} --timestamps${sinceTime}`, false, true);
}
catch (error) {
cloud_runner_logger_1.default.log(`K8s logging error ${error}`);
const continueStreaming = error.includes(`dial timeout, backstop`) ||
error.includes(`HttpError: HTTP request failed`) ||
error.includes(`an error occurred when try to find container`) ||
error.includes(`not found`) ||
error.includes(`Not Found`);
cloud_runner_logger_1.default.log(`K8s logging error ${error} ${continueStreaming}`);
if (continueStreaming) {
continue;
}
throw error;
}
const splitLogs = logs.split(`\n`);

2
dist/index.js.map generated vendored

File diff suppressed because one or more lines are too long

View File

@ -102,6 +102,7 @@ class KubernetesJobSpecFactory {
],
containers: [
{
ttlSecondsAfterFinished: 9999,
name: KubernetesJobSpecFactory.MainContainerName,
image,
command: ['/bin/sh'],

View File

@ -49,7 +49,16 @@ class KubernetesTaskRunner {
true,
);
} catch (error: any) {
CloudRunnerLogger.log(`K8s logging error ${error}`);
const continueStreaming =
error.includes(`dial timeout, backstop`) ||
error.includes(`HttpError: HTTP request failed`) ||
error.includes(`an error occurred when try to find container`) ||
error.includes(`not found`) ||
error.includes(`Not Found`);
CloudRunnerLogger.log(`K8s logging error ${error} ${continueStreaming}`);
if (continueStreaming) {
continue;
}
throw error;
}
const splitLogs = logs.split(`\n`);