End of log stream message
parent
896e754512
commit
4d622063ea
|
|
@ -1042,22 +1042,16 @@ class Kubernetes {
|
|||
});
|
||||
}
|
||||
static streamLogs(name, namespace, container) {
|
||||
var _a;
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
try {
|
||||
let running = true;
|
||||
while (running) {
|
||||
const pod = yield this.kubeClient.readNamespacedPod(name, namespace);
|
||||
running = ((_a = pod.body.status) === null || _a === void 0 ? void 0 : _a.phase) === 'Running';
|
||||
yield new Promise((resolve) => setTimeout(resolve, pollInterval));
|
||||
core.info('Polling logs...');
|
||||
const stream = new stream_1.Writable();
|
||||
stream._write = (chunk, encoding, next) => {
|
||||
core.info(chunk.toString());
|
||||
next();
|
||||
};
|
||||
yield new Promise((resolve) => new client_node_1.Log(this.kubeConfig).log(namespace, name, container, stream, resolve));
|
||||
}
|
||||
core.info('Polling logs...');
|
||||
const stream = new stream_1.Writable();
|
||||
stream._write = (chunk, encoding, next) => {
|
||||
core.info(chunk.toString());
|
||||
next();
|
||||
};
|
||||
yield new Promise((resolve) => new client_node_1.Log(this.kubeConfig).log(namespace, name, container, stream, resolve));
|
||||
core.info('end of log stream');
|
||||
}
|
||||
catch (error) {
|
||||
core.error(JSON.stringify(error, undefined, 4));
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -334,19 +334,14 @@ class Kubernetes {
|
|||
|
||||
static async streamLogs(name: string, namespace: string, container: string) {
|
||||
try {
|
||||
let running = true;
|
||||
while (running) {
|
||||
const pod = await this.kubeClient.readNamespacedPod(name, namespace);
|
||||
running = pod.body.status?.phase === 'Running';
|
||||
await new Promise((resolve) => setTimeout(resolve, pollInterval));
|
||||
core.info('Polling logs...');
|
||||
const stream = new Writable();
|
||||
stream._write = (chunk, encoding, next) => {
|
||||
core.info(chunk.toString());
|
||||
next();
|
||||
};
|
||||
await new Promise((resolve) => new Log(this.kubeConfig).log(namespace, name, container, stream, resolve));
|
||||
}
|
||||
core.info('Polling logs...');
|
||||
const stream = new Writable();
|
||||
stream._write = (chunk, encoding, next) => {
|
||||
core.info(chunk.toString());
|
||||
next();
|
||||
};
|
||||
await new Promise((resolve) => new Log(this.kubeConfig).log(namespace, name, container, stream, resolve));
|
||||
core.info('end of log stream');
|
||||
} catch (error) {
|
||||
core.error(JSON.stringify(error, undefined, 4));
|
||||
throw error;
|
||||
|
|
|
|||
Loading…
Reference in New Issue