pull/524/head
Frostebite 2023-03-17 22:45:05 +00:00
parent 820fd169ec
commit 890f64d0a1
3 changed files with 20 additions and 17 deletions

12
dist/index.js generated vendored
View File

@ -3762,9 +3762,11 @@ class KubernetesTaskRunner {
const dateString = `${chunk.toString().split(`Z `)[0]}Z`;
const newDate = Date.parse(dateString);
new Date(newDate).toISOString();
KubernetesTaskRunner.lastReceivedTimestamp = newDate;
const message = cloud_runner_1.default.buildParameters.cloudRunnerDebug ? chunk : chunk.split(`Z `)[1];
({ shouldReadLogs, shouldCleanup, output } = follow_log_stream_service_1.FollowLogStreamService.handleIteration(message, shouldReadLogs, shouldCleanup, output));
if (KubernetesTaskRunner.lastReceivedTimestamp < newDate) {
KubernetesTaskRunner.lastReceivedTimestamp = newDate;
const message = cloud_runner_1.default.buildParameters.cloudRunnerDebug ? chunk : chunk.split(`Z `)[1];
({ shouldReadLogs, shouldCleanup, output } = follow_log_stream_service_1.FollowLogStreamService.handleIteration(message, shouldReadLogs, shouldCleanup, output));
}
}
if (!didStreamAnyLogs) {
core.error('Failed to stream any logs, listing namespace events, check for an error with the container');
@ -3783,11 +3785,11 @@ class KubernetesTaskRunner {
}, undefined, 4));
throw new Error(`No logs streamed from k8s`);
}
cloud_runner_logger_1.default.log('end of log stream');
}
catch (error) {
cloud_runner_logger_1.default.log(`k8s task runner failed ${JSON.stringify(error, undefined, 4)}`);
cloud_runner_logger_1.default.log(`k8s stream watching failed ${JSON.stringify(error, undefined, 4)}`);
}
cloud_runner_logger_1.default.log('end of log stream');
return output;
}
static async watchUntilPodRunning(kubeClient, podName, namespace) {

2
dist/index.js.map generated vendored

File diff suppressed because one or more lines are too long

View File

@ -43,15 +43,16 @@ class KubernetesTaskRunner {
const dateString = `${chunk.toString().split(`Z `)[0]}Z`;
const newDate = Date.parse(dateString);
new Date(newDate).toISOString();
KubernetesTaskRunner.lastReceivedTimestamp = newDate;
const message = CloudRunner.buildParameters.cloudRunnerDebug ? chunk : chunk.split(`Z `)[1];
({ shouldReadLogs, shouldCleanup, output } = FollowLogStreamService.handleIteration(
message,
shouldReadLogs,
shouldCleanup,
output,
));
if (KubernetesTaskRunner.lastReceivedTimestamp < newDate) {
KubernetesTaskRunner.lastReceivedTimestamp = newDate;
const message = CloudRunner.buildParameters.cloudRunnerDebug ? chunk : chunk.split(`Z `)[1];
({ shouldReadLogs, shouldCleanup, output } = FollowLogStreamService.handleIteration(
message,
shouldReadLogs,
shouldCleanup,
output,
));
}
}
if (!didStreamAnyLogs) {
@ -77,10 +78,10 @@ class KubernetesTaskRunner {
);
throw new Error(`No logs streamed from k8s`);
}
CloudRunnerLogger.log('end of log stream');
} catch (error: any) {
CloudRunnerLogger.log(`k8s task runner failed ${JSON.stringify(error, undefined, 4)}`);
CloudRunnerLogger.log(`k8s stream watching failed ${JSON.stringify(error, undefined, 4)}`);
}
CloudRunnerLogger.log('end of log stream');
return output;
}