pull/310/head
Frostebite 2021-12-31 23:52:27 +00:00
parent 452b48881d
commit 6ecaaecbad
3 changed files with 8 additions and 10 deletions

7
dist/index.js vendored
View File

@ -2461,14 +2461,11 @@ class KubernetesTaskRunner {
let success = false;
cloud_runner_logger_1.default.log(`Watching ${podName} ${namespace}`);
yield async_wait_until_1.default(() => __awaiter(this, void 0, void 0, function* () {
var _a, _b, _c, _d;
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].message) || ''}`);
if (__1.Input.cloudRunnerTests) {
cloud_runner_logger_1.default.log(`${JSON.stringify(status, undefined, 4)}`);
}
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) || ''}`);
if (success || phase !== 'Pending')
return true;
return false;

2
dist/index.js.map vendored

File diff suppressed because one or more lines are too long

View File

@ -80,10 +80,11 @@ class KubernetesTaskRunner {
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].message || ''}`);
if (Input.cloudRunnerTests) {
CloudRunnerLogger.log(`${JSON.stringify(status, undefined, 4)}`);
}
CloudRunnerLogger.log(
`${status.body.status?.phase} ${status.body.status?.conditions?.[0].reason || ''} ${
status.body.status?.conditions?.[0].message || ''
}`,
);
if (success || phase !== 'Pending') return true;
return false;
},