hashed logging k8s
parent
368f63e404
commit
6bd6fddf40
|
|
@ -3957,18 +3957,21 @@ class KubernetesTaskRunner {
|
||||||
let logs;
|
let logs;
|
||||||
const callback = (outputChunk) => {
|
const callback = (outputChunk) => {
|
||||||
output += outputChunk;
|
output += outputChunk;
|
||||||
|
// split output chunk and handle per line
|
||||||
|
for (const chunk of outputChunk.split(`\n`)) {
|
||||||
// check if log start included in logs if so log a message
|
// check if log start included in logs if so log a message
|
||||||
if (outputChunk.includes(`Collected Logs`)) {
|
if (chunk.includes(`Collected Logs`)) {
|
||||||
cloud_runner_logger_1.default.log(`Log Start found in logs`);
|
cloud_runner_logger_1.default.log(`Log Start found in logs`);
|
||||||
}
|
}
|
||||||
if (outputChunk.includes(`LOGHASH:`)) {
|
if (chunk.includes(`LOGHASH:`)) {
|
||||||
remote_client_logger_1.RemoteClientLogger.HandleLogChunkLine(outputChunk);
|
remote_client_logger_1.RemoteClientLogger.HandleLogChunkLine(chunk);
|
||||||
cloud_runner_logger_1.default.log(`Loghash found`);
|
cloud_runner_logger_1.default.log(`Loghash found`);
|
||||||
}
|
}
|
||||||
if (outputChunk.includes(`LOGS:`)) {
|
if (chunk.includes(`LOGS:`)) {
|
||||||
const result = remote_client_logger_1.RemoteClientLogger.HandleLogChunkLine(outputChunk);
|
const result = remote_client_logger_1.RemoteClientLogger.HandleLogChunkLine(chunk);
|
||||||
cloud_runner_logger_1.default.log(`Logs found HandleLogChunkLineResult:${result}`);
|
cloud_runner_logger_1.default.log(`Logs found HandleLogChunkLineResult:${result}`);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
try {
|
try {
|
||||||
logs = await cloud_runner_system_1.CloudRunnerSystem.Run(`kubectl logs ${podName}${extraFlags}`, false, true, callback);
|
logs = await cloud_runner_system_1.CloudRunnerSystem.Run(`kubectl logs ${podName}${extraFlags}`, false, true, callback);
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -36,18 +36,21 @@ class KubernetesTaskRunner {
|
||||||
const callback = (outputChunk: string) => {
|
const callback = (outputChunk: string) => {
|
||||||
output += outputChunk;
|
output += outputChunk;
|
||||||
|
|
||||||
|
// split output chunk and handle per line
|
||||||
|
for (const chunk of outputChunk.split(`\n`)) {
|
||||||
// check if log start included in logs if so log a message
|
// check if log start included in logs if so log a message
|
||||||
if (outputChunk.includes(`Collected Logs`)) {
|
if (chunk.includes(`Collected Logs`)) {
|
||||||
CloudRunnerLogger.log(`Log Start found in logs`);
|
CloudRunnerLogger.log(`Log Start found in logs`);
|
||||||
}
|
}
|
||||||
if (outputChunk.includes(`LOGHASH:`)) {
|
if (chunk.includes(`LOGHASH:`)) {
|
||||||
RemoteClientLogger.HandleLogChunkLine(outputChunk);
|
RemoteClientLogger.HandleLogChunkLine(chunk);
|
||||||
CloudRunnerLogger.log(`Loghash found`);
|
CloudRunnerLogger.log(`Loghash found`);
|
||||||
}
|
}
|
||||||
if (outputChunk.includes(`LOGS:`)) {
|
if (chunk.includes(`LOGS:`)) {
|
||||||
const result = RemoteClientLogger.HandleLogChunkLine(outputChunk);
|
const result = RemoteClientLogger.HandleLogChunkLine(chunk);
|
||||||
CloudRunnerLogger.log(`Logs found HandleLogChunkLineResult:${result}`);
|
CloudRunnerLogger.log(`Logs found HandleLogChunkLineResult:${result}`);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
try {
|
try {
|
||||||
logs = await CloudRunnerSystem.Run(`kubectl logs ${podName}${extraFlags}`, false, true, callback);
|
logs = await CloudRunnerSystem.Run(`kubectl logs ${podName}${extraFlags}`, false, true, callback);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue