events log cleanup
parent
beff5eb6ff
commit
cef784e8f8
|
@ -4094,21 +4094,21 @@ class KubernetesTaskRunner {
|
|||
return __awaiter(this, void 0, void 0, function* () {
|
||||
let success = false;
|
||||
cloud_runner_logger_1.default.log(`Watching ${podName} ${namespace}`);
|
||||
cloud_runner_logger_1.default.log(JSON.stringify((yield kubeClient.listNamespacedEvent(namespace)).body.items
|
||||
.map((x) => {
|
||||
return {
|
||||
message: x.message || ``,
|
||||
name: x.metadata.name || ``,
|
||||
reason: x.reason || ``,
|
||||
};
|
||||
})
|
||||
.filter((x) => x.name.includes(podName)), undefined, 4));
|
||||
yield async_wait_until_1.default(() => __awaiter(this, void 0, void 0, function* () {
|
||||
var _a, _b, _c, _d, _e, _f;
|
||||
const status = yield kubeClient.readNamespacedPodStatus(podName, namespace);
|
||||
const phase = (_a = status === null || status === void 0 ? void 0 : status.body.status) === null || _a === void 0 ? void 0 : _a.phase;
|
||||
success = phase === 'Running';
|
||||
cloud_runner_logger_1.default.log(`${(_b = status.body.status) === null || _b === void 0 ? void 0 : _b.phase} ${((_d = (_c = status.body.status) === null || _c === void 0 ? void 0 : _c.conditions) === null || _d === void 0 ? void 0 : _d[0].reason) || ''} ${((_f = (_e = status.body.status) === null || _e === void 0 ? void 0 : _e.conditions) === null || _f === void 0 ? void 0 : _f[0].message) || ''}`);
|
||||
cloud_runner_logger_1.default.log(`Phase:${(_b = status.body.status) === null || _b === void 0 ? void 0 : _b.phase} Reason:${((_d = (_c = status.body.status) === null || _c === void 0 ? void 0 : _c.conditions) === null || _d === void 0 ? void 0 : _d[0].reason) || ''} Message:${((_f = (_e = status.body.status) === null || _e === void 0 ? void 0 : _e.conditions) === null || _f === void 0 ? void 0 : _f[0].message) || ''}`);
|
||||
cloud_runner_logger_1.default.log(JSON.stringify((yield kubeClient.listNamespacedEvent(namespace)).body.items
|
||||
.map((x) => {
|
||||
return {
|
||||
message: x.message || ``,
|
||||
name: x.metadata.name || ``,
|
||||
reason: x.reason || ``,
|
||||
};
|
||||
})
|
||||
.filter((x) => x.name.includes(podName)), undefined, 4));
|
||||
if (success || phase !== 'Pending')
|
||||
return true;
|
||||
return false;
|
||||
|
@ -4116,15 +4116,6 @@ class KubernetesTaskRunner {
|
|||
timeout: 2000000,
|
||||
intervalBetweenAttempts: 15000,
|
||||
});
|
||||
cloud_runner_logger_1.default.log(JSON.stringify((yield kubeClient.listNamespacedEvent(namespace)).body.items
|
||||
.map((x) => {
|
||||
return {
|
||||
message: x.message || ``,
|
||||
name: x.metadata.name || ``,
|
||||
reason: x.reason || ``,
|
||||
};
|
||||
})
|
||||
.filter((x) => x.name.includes(podName)), undefined, 4));
|
||||
return success;
|
||||
});
|
||||
}
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -120,31 +120,31 @@ class KubernetesTaskRunner {
|
|||
static async watchUntilPodRunning(kubeClient: CoreV1Api, podName: string, namespace: string) {
|
||||
let success: boolean = false;
|
||||
CloudRunnerLogger.log(`Watching ${podName} ${namespace}`);
|
||||
CloudRunnerLogger.log(
|
||||
JSON.stringify(
|
||||
(await kubeClient.listNamespacedEvent(namespace)).body.items
|
||||
.map((x) => {
|
||||
return {
|
||||
message: x.message || ``,
|
||||
name: x.metadata.name || ``,
|
||||
reason: x.reason || ``,
|
||||
};
|
||||
})
|
||||
.filter((x) => x.name.includes(podName)),
|
||||
undefined,
|
||||
4,
|
||||
),
|
||||
);
|
||||
await waitUntil(
|
||||
async () => {
|
||||
const status = await kubeClient.readNamespacedPodStatus(podName, namespace);
|
||||
const phase = status?.body.status?.phase;
|
||||
success = phase === 'Running';
|
||||
CloudRunnerLogger.log(
|
||||
`${status.body.status?.phase} ${status.body.status?.conditions?.[0].reason || ''} ${
|
||||
`Phase:${status.body.status?.phase} Reason:${status.body.status?.conditions?.[0].reason || ''} Message:${
|
||||
status.body.status?.conditions?.[0].message || ''
|
||||
}`,
|
||||
);
|
||||
CloudRunnerLogger.log(
|
||||
JSON.stringify(
|
||||
(await kubeClient.listNamespacedEvent(namespace)).body.items
|
||||
.map((x) => {
|
||||
return {
|
||||
message: x.message || ``,
|
||||
name: x.metadata.name || ``,
|
||||
reason: x.reason || ``,
|
||||
};
|
||||
})
|
||||
.filter((x) => x.name.includes(podName)),
|
||||
undefined,
|
||||
4,
|
||||
),
|
||||
);
|
||||
if (success || phase !== 'Pending') return true;
|
||||
|
||||
return false;
|
||||
|
@ -155,22 +155,6 @@ class KubernetesTaskRunner {
|
|||
},
|
||||
);
|
||||
|
||||
CloudRunnerLogger.log(
|
||||
JSON.stringify(
|
||||
(await kubeClient.listNamespacedEvent(namespace)).body.items
|
||||
.map((x) => {
|
||||
return {
|
||||
message: x.message || ``,
|
||||
name: x.metadata.name || ``,
|
||||
reason: x.reason || ``,
|
||||
};
|
||||
})
|
||||
.filter((x) => x.name.includes(podName)),
|
||||
undefined,
|
||||
4,
|
||||
),
|
||||
);
|
||||
|
||||
return success;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue