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

6
dist/index.js vendored
View File

@ -3762,10 +3762,12 @@ class KubernetesTaskRunner {
const dateString = `${chunk.toString().split(`Z `)[0]}Z`;
const newDate = Date.parse(dateString);
new Date(newDate).toISOString();
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');
core.error(JSON.stringify({
@ -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 vendored

File diff suppressed because one or more lines are too long

View File

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