fixes
parent
890f64d0a1
commit
fb0a4cde42
|
|
@ -3753,8 +3753,9 @@ class KubernetesTaskRunner {
|
||||||
const sinceTime = KubernetesTaskRunner.lastReceivedTimestamp
|
const sinceTime = KubernetesTaskRunner.lastReceivedTimestamp
|
||||||
? `--since-time="${new Date(KubernetesTaskRunner.lastReceivedTimestamp + 1).toISOString()}" `
|
? `--since-time="${new Date(KubernetesTaskRunner.lastReceivedTimestamp + 1).toISOString()}" `
|
||||||
: ` `;
|
: ` `;
|
||||||
|
let started = false;
|
||||||
// using this instead of Kube
|
// 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`);
|
const splitLogs = logs.split(`\n`);
|
||||||
for (const element of splitLogs) {
|
for (const element of splitLogs) {
|
||||||
didStreamAnyLogs = true;
|
didStreamAnyLogs = true;
|
||||||
|
|
@ -3763,10 +3764,14 @@ class KubernetesTaskRunner {
|
||||||
const newDate = Date.parse(dateString);
|
const newDate = Date.parse(dateString);
|
||||||
new Date(newDate).toISOString();
|
new Date(newDate).toISOString();
|
||||||
if (KubernetesTaskRunner.lastReceivedTimestamp < newDate) {
|
if (KubernetesTaskRunner.lastReceivedTimestamp < newDate) {
|
||||||
KubernetesTaskRunner.lastReceivedTimestamp = newDate;
|
started = true;
|
||||||
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 (!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) {
|
if (!didStreamAnyLogs) {
|
||||||
core.error('Failed to stream any logs, listing namespace events, check for an error with the container');
|
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
|
const sinceTime = KubernetesTaskRunner.lastReceivedTimestamp
|
||||||
? `--since-time="${new Date(KubernetesTaskRunner.lastReceivedTimestamp + 1).toISOString()}" `
|
? `--since-time="${new Date(KubernetesTaskRunner.lastReceivedTimestamp + 1).toISOString()}" `
|
||||||
: ` `;
|
: ` `;
|
||||||
|
let started = false;
|
||||||
|
|
||||||
// using this instead of Kube
|
// using this instead of Kube
|
||||||
const logs = await CloudRunnerSystem.Run(
|
const logs = await CloudRunnerSystem.Run(
|
||||||
`kubectl logs ${podName} -c ${containerName} --timestamps ${sinceTime}`,
|
`kubectl logs ${podName} -f -c ${containerName} --timestamps ${sinceTime}`,
|
||||||
false,
|
false,
|
||||||
true,
|
true,
|
||||||
);
|
);
|
||||||
|
|
@ -44,15 +45,19 @@ class KubernetesTaskRunner {
|
||||||
const newDate = Date.parse(dateString);
|
const newDate = Date.parse(dateString);
|
||||||
new Date(newDate).toISOString();
|
new Date(newDate).toISOString();
|
||||||
if (KubernetesTaskRunner.lastReceivedTimestamp < newDate) {
|
if (KubernetesTaskRunner.lastReceivedTimestamp < newDate) {
|
||||||
KubernetesTaskRunner.lastReceivedTimestamp = newDate;
|
started = true;
|
||||||
const message = CloudRunner.buildParameters.cloudRunnerDebug ? chunk : chunk.split(`Z `)[1];
|
|
||||||
({ shouldReadLogs, shouldCleanup, output } = FollowLogStreamService.handleIteration(
|
|
||||||
message,
|
|
||||||
shouldReadLogs,
|
|
||||||
shouldCleanup,
|
|
||||||
output,
|
|
||||||
));
|
|
||||||
}
|
}
|
||||||
|
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) {
|
if (!didStreamAnyLogs) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue