follow logs
parent
0bc5cf2adb
commit
645ce0ff06
|
|
@ -1011,9 +1011,9 @@ class Kubernetes {
|
|||
});
|
||||
}
|
||||
static watchBuildJobUntilFinished() {
|
||||
var _a, _b, _c, _d;
|
||||
var _a, _b, _c, _d, _e, _f;
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
let podname;
|
||||
let podname, containerId;
|
||||
let ready = false;
|
||||
while (!ready) {
|
||||
yield new Promise((resolve) => setTimeout(resolve, pollInterval));
|
||||
|
|
@ -1030,13 +1030,13 @@ class Kubernetes {
|
|||
else {
|
||||
ready = true;
|
||||
podname = (_d = element.metadata) === null || _d === void 0 ? void 0 : _d.name;
|
||||
core.info(JSON.stringify(element, undefined, 4));
|
||||
containerId = (_f = (_e = element.status) === null || _e === void 0 ? void 0 : _e.containerStatuses) === null || _f === void 0 ? void 0 : _f[0].containerID;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
core.info(`Watching build job ${podname}`);
|
||||
const logs = yield this.kubeClient.readNamespacedPodLog(podname, this.namespace, undefined, true);
|
||||
const logs = yield this.kubeClient.readNamespacedPodLog(podname, this.namespace, containerId, true);
|
||||
yield new Promise((resolve, reject) => {
|
||||
logs.response.on('data', (chunk) => {
|
||||
core.info(chunk);
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -297,7 +297,7 @@ class Kubernetes {
|
|||
}
|
||||
|
||||
static async watchBuildJobUntilFinished() {
|
||||
let podname;
|
||||
let podname, containerId;
|
||||
let ready = false;
|
||||
while (!ready) {
|
||||
await new Promise((resolve) => setTimeout(resolve, pollInterval));
|
||||
|
|
@ -313,7 +313,7 @@ class Kubernetes {
|
|||
} else {
|
||||
ready = true;
|
||||
podname = element.metadata?.name;
|
||||
core.info(JSON.stringify(element, undefined, 4));
|
||||
containerId = element.status?.containerStatuses?.[0].containerID;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -321,7 +321,7 @@ class Kubernetes {
|
|||
|
||||
core.info(`Watching build job ${podname}`);
|
||||
|
||||
const logs = await this.kubeClient.readNamespacedPodLog(podname, this.namespace, undefined, true);
|
||||
const logs = await this.kubeClient.readNamespacedPodLog(podname, this.namespace, containerId, true);
|
||||
await new Promise((resolve, reject) => {
|
||||
logs.response.on('data', (chunk) => {
|
||||
core.info(chunk);
|
||||
|
|
|
|||
Loading…
Reference in New Issue