logging improvement

pull/265/head
Frostebite 2021-05-23 23:19:04 +01:00
parent 7995193cd8
commit 1d4028c426
3 changed files with 4 additions and 9 deletions

4
dist/index.js vendored
View File

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

2
dist/index.js.map vendored

File diff suppressed because one or more lines are too long

View File

@ -342,12 +342,7 @@ class Kubernetes {
);
let logs;
try {
logs = await this.kubeClient.readNamespacedPodLog(
pod.metadata?.name || '',
this.namespace,
pod.status?.containerStatuses?.[0].containerID,
true,
);
logs = await this.kubeClient.readNamespacedPodLog(pod.metadata?.name || '', this.namespace, undefined, true);
} catch (error) {
core.error(error);
throw error;