fixes
parent
890f64d0a1
commit
fb0a4cde42
|
@ -3753,8 +3753,9 @@ class KubernetesTaskRunner {
|
|||
const sinceTime = KubernetesTaskRunner.lastReceivedTimestamp
|
||||
? `--since-time="${new Date(KubernetesTaskRunner.lastReceivedTimestamp + 1).toISOString()}" `
|
||||
: ` `;
|
||||
let started = false;
|
||||
// using this instead of Kube
|
||||
const logs = await cloud_runner_system_1.CloudRunnerSystem.Run(`kubectl logs ${podName} -c ${containerName} --timestamps ${sinceTime}`, false, true);
|
||||
const logs = await cloud_runner_system_1.CloudRunnerSystem.Run(`kubectl logs ${podName} -f -c ${containerName} --timestamps ${sinceTime}`, false, true);
|
||||
const splitLogs = logs.split(`\n`);
|
||||
for (const element of splitLogs) {
|
||||
didStreamAnyLogs = true;
|
||||
|
@ -3763,10 +3764,14 @@ class KubernetesTaskRunner {
|
|||
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));
|
||||
started = true;
|
||||
}
|
||||
if (!started) {
|
||||
continue;
|
||||
}
|
||||
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');
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -29,10 +29,11 @@ class KubernetesTaskRunner {
|
|||
const sinceTime = KubernetesTaskRunner.lastReceivedTimestamp
|
||||
? `--since-time="${new Date(KubernetesTaskRunner.lastReceivedTimestamp + 1).toISOString()}" `
|
||||
: ` `;
|
||||
let started = false;
|
||||
|
||||
// using this instead of Kube
|
||||
const logs = await CloudRunnerSystem.Run(
|
||||
`kubectl logs ${podName} -c ${containerName} --timestamps ${sinceTime}`,
|
||||
`kubectl logs ${podName} -f -c ${containerName} --timestamps ${sinceTime}`,
|
||||
false,
|
||||
true,
|
||||
);
|
||||
|
@ -44,15 +45,19 @@ class KubernetesTaskRunner {
|
|||
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,
|
||||
shouldReadLogs,
|
||||
shouldCleanup,
|
||||
output,
|
||||
));
|
||||
started = true;
|
||||
}
|
||||
if (!started) {
|
||||
continue;
|
||||
}
|
||||
KubernetesTaskRunner.lastReceivedTimestamp = newDate;
|
||||
const message = CloudRunner.buildParameters.cloudRunnerDebug ? chunk : chunk.split(`Z `)[1];
|
||||
({ shouldReadLogs, shouldCleanup, output } = FollowLogStreamService.handleIteration(
|
||||
message,
|
||||
shouldReadLogs,
|
||||
shouldCleanup,
|
||||
output,
|
||||
));
|
||||
}
|
||||
|
||||
if (!didStreamAnyLogs) {
|
||||
|
|
Loading…
Reference in New Issue