Improve k8s logging accuracy
parent
8e0168a0a5
commit
4e2f2ef206
|
|
@ -1717,6 +1717,9 @@ class AWSTaskRunner {
|
||||||
const containerState = (_q = taskData.containers) === null || _q === void 0 ? void 0 : _q[0];
|
const containerState = (_q = taskData.containers) === null || _q === void 0 ? void 0 : _q[0];
|
||||||
const exitCode = (containerState === null || containerState === void 0 ? void 0 : containerState.exitCode) || undefined;
|
const exitCode = (containerState === null || containerState === void 0 ? void 0 : containerState.exitCode) || undefined;
|
||||||
cloud_runner_logger_1.default.log(`Container State: ${JSON.stringify(containerState, undefined, 4)}`);
|
cloud_runner_logger_1.default.log(`Container State: ${JSON.stringify(containerState, undefined, 4)}`);
|
||||||
|
if (exitCode === undefined) {
|
||||||
|
cloud_runner_logger_1.default.logWarning(`No exitcode for container`);
|
||||||
|
}
|
||||||
const wasSuccessful = exitCode === 0 || (exitCode === undefined && taskData.lastStatus === 'RUNNING');
|
const wasSuccessful = exitCode === 0 || (exitCode === undefined && taskData.lastStatus === 'RUNNING');
|
||||||
if (wasSuccessful) {
|
if (wasSuccessful) {
|
||||||
cloud_runner_logger_1.default.log(`Cloud runner job has finished successfully`);
|
cloud_runner_logger_1.default.log(`Cloud runner job has finished successfully`);
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -77,6 +77,9 @@ class AWSTaskRunner {
|
||||||
const containerState = taskData.containers?.[0];
|
const containerState = taskData.containers?.[0];
|
||||||
const exitCode = containerState?.exitCode || undefined;
|
const exitCode = containerState?.exitCode || undefined;
|
||||||
CloudRunnerLogger.log(`Container State: ${JSON.stringify(containerState, undefined, 4)}`);
|
CloudRunnerLogger.log(`Container State: ${JSON.stringify(containerState, undefined, 4)}`);
|
||||||
|
if (exitCode === undefined) {
|
||||||
|
CloudRunnerLogger.logWarning(`No exitcode for container`);
|
||||||
|
}
|
||||||
const wasSuccessful = exitCode === 0 || (exitCode === undefined && taskData.lastStatus === 'RUNNING');
|
const wasSuccessful = exitCode === 0 || (exitCode === undefined && taskData.lastStatus === 'RUNNING');
|
||||||
if (wasSuccessful) {
|
if (wasSuccessful) {
|
||||||
CloudRunnerLogger.log(`Cloud runner job has finished successfully`);
|
CloudRunnerLogger.log(`Cloud runner job has finished successfully`);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue