log container state

pull/265/head
Frostebite 2021-05-23 22:26:18 +01:00
parent fe370d44d8
commit c9cb010cfa
3 changed files with 7 additions and 7 deletions

10
dist/index.js vendored
View File

@ -1043,18 +1043,18 @@ class Kubernetes {
}); });
} }
static watchBuildJobUntilFinished() { static watchBuildJobUntilFinished() {
var _a, _b, _c, _d, _e, _f, _g; var _a, _b, _c, _d, _e, _f, _g, _h, _j;
return __awaiter(this, void 0, void 0, function* () { return __awaiter(this, void 0, void 0, function* () {
const pod = (yield Kubernetes.watchPodUntilReadyAndRead()) || {}; const pod = (yield Kubernetes.watchPodUntilReadyAndRead()) || {};
core.info(`Watching build job ${(_a = pod.metadata) === null || _a === void 0 ? void 0 : _a.name}`); core.info(`Watching build job ${(_a = pod.metadata) === null || _a === void 0 ? void 0 : _a.name} ${(_c = (_b = pod.status) === null || _b === void 0 ? void 0 : _b.containerStatuses) === null || _c === void 0 ? void 0 : _c[0].state}`);
core.info(JSON.stringify({ core.info(JSON.stringify({
name: ((_b = pod.metadata) === null || _b === void 0 ? void 0 : _b.name) || '', name: ((_d = pod.metadata) === null || _d === void 0 ? void 0 : _d.name) || '',
namespace: this.namespace, namespace: this.namespace,
container: (_d = (_c = pod.status) === null || _c === void 0 ? void 0 : _c.containerStatuses) === null || _d === void 0 ? void 0 : _d[0].containerID, container: (_f = (_e = pod.status) === null || _e === void 0 ? void 0 : _e.containerStatuses) === null || _f === void 0 ? void 0 : _f[0].containerID,
}, undefined, 4)); }, undefined, 4));
let logs; let logs;
try { try {
logs = yield this.kubeClient.readNamespacedPodLog(((_e = pod.metadata) === null || _e === void 0 ? void 0 : _e.name) || '', this.namespace, (_g = (_f = pod.status) === null || _f === void 0 ? void 0 : _f.containerStatuses) === null || _g === void 0 ? void 0 : _g[0].containerID, true); logs = yield this.kubeClient.readNamespacedPodLog(((_g = pod.metadata) === null || _g === void 0 ? void 0 : _g.name) || '', this.namespace, (_j = (_h = pod.status) === null || _h === void 0 ? void 0 : _h.containerStatuses) === null || _j === void 0 ? void 0 : _j[0].containerID, true);
} }
catch (error) { catch (error) {
core.error(error); core.error(error);

2
dist/index.js.map vendored

File diff suppressed because one or more lines are too long

View File

@ -331,7 +331,7 @@ class Kubernetes {
static async watchBuildJobUntilFinished() { static async watchBuildJobUntilFinished() {
const pod = (await Kubernetes.watchPodUntilReadyAndRead()) || {}; const pod = (await Kubernetes.watchPodUntilReadyAndRead()) || {};
core.info(`Watching build job ${pod.metadata?.name}`); core.info(`Watching build job ${pod.metadata?.name} ${pod.status?.containerStatuses?.[0].state}`);
core.info( core.info(
JSON.stringify( JSON.stringify(