fix
parent
95e005365f
commit
ce724d8304
|
|
@ -2296,23 +2296,23 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|||
const client_node_1 = __webpack_require__(89679);
|
||||
const stream_1 = __webpack_require__(92413);
|
||||
const cloud_runner_logger_1 = __importDefault(__webpack_require__(22855));
|
||||
const cloud_runner_state_1 = __webpack_require__(70912);
|
||||
const core = __importStar(__webpack_require__(42186));
|
||||
const fs_1 = __importDefault(__webpack_require__(35747));
|
||||
const cloud_runner_statics_1 = __webpack_require__(90828);
|
||||
const async_wait_until_1 = __importDefault(__webpack_require__(41299));
|
||||
const __1 = __webpack_require__(41359);
|
||||
class KubernetesTaskRunner {
|
||||
static runTask(kubeConfig, kubeClient, jobName, podName, containerName, namespace, logCallback) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
cloud_runner_logger_1.default.log(`Streaming logs from pod: ${podName} container: ${containerName} namespace: ${namespace}`);
|
||||
const stream = new stream_1.Writable();
|
||||
let output = '';
|
||||
let didStreamAnyLogs = false;
|
||||
stream._write = (chunk, encoding, next) => {
|
||||
didStreamAnyLogs = true;
|
||||
let message = chunk.toString();
|
||||
message = `[${cloud_runner_statics_1.CloudRunnerStatics.logPrefix}] ${message}`;
|
||||
if (cloud_runner_state_1.CloudRunnerState.buildParams.logToFile) {
|
||||
fs_1.default.appendFileSync(`${cloud_runner_state_1.CloudRunnerState.buildParams.buildGuid}-outputfile.txt`, `${message}\n`);
|
||||
if (__1.Input.cloudRunnerTests) {
|
||||
output += message;
|
||||
}
|
||||
logCallback(message);
|
||||
next();
|
||||
|
|
@ -2349,6 +2349,7 @@ class KubernetesTaskRunner {
|
|||
throw error;
|
||||
}
|
||||
cloud_runner_logger_1.default.log('end of log stream');
|
||||
return output;
|
||||
});
|
||||
}
|
||||
static watchUntilPodRunning(kubeClient, podName, namespace) {
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -1,11 +1,10 @@
|
|||
import { CoreV1Api, KubeConfig, Log } from '@kubernetes/client-node';
|
||||
import { Writable } from 'stream';
|
||||
import CloudRunnerLogger from '../services/cloud-runner-logger';
|
||||
import { CloudRunnerState } from '../state/cloud-runner-state';
|
||||
import * as core from '@actions/core';
|
||||
import fs from 'fs';
|
||||
import { CloudRunnerStatics } from '../cloud-runner-statics';
|
||||
import waitUntil from 'async-wait-until';
|
||||
import { Input } from '../..';
|
||||
|
||||
class KubernetesTaskRunner {
|
||||
static async runTask(
|
||||
|
|
@ -19,13 +18,14 @@ class KubernetesTaskRunner {
|
|||
) {
|
||||
CloudRunnerLogger.log(`Streaming logs from pod: ${podName} container: ${containerName} namespace: ${namespace}`);
|
||||
const stream = new Writable();
|
||||
let output = '';
|
||||
let didStreamAnyLogs: boolean = false;
|
||||
stream._write = (chunk, encoding, next) => {
|
||||
didStreamAnyLogs = true;
|
||||
let message = chunk.toString();
|
||||
message = `[${CloudRunnerStatics.logPrefix}] ${message}`;
|
||||
if (CloudRunnerState.buildParams.logToFile) {
|
||||
fs.appendFileSync(`${CloudRunnerState.buildParams.buildGuid}-outputfile.txt`, `${message}\n`);
|
||||
if (Input.cloudRunnerTests) {
|
||||
output += message;
|
||||
}
|
||||
logCallback(message);
|
||||
next();
|
||||
|
|
@ -69,6 +69,7 @@ class KubernetesTaskRunner {
|
|||
throw error;
|
||||
}
|
||||
CloudRunnerLogger.log('end of log stream');
|
||||
return output;
|
||||
}
|
||||
|
||||
static async watchUntilPodRunning(kubeClient: CoreV1Api, podName: string, namespace: string) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue