push k8s logs to LOG SERVICE IP

This commit is contained in:
Frostebite 2023-07-17 23:17:07 +01:00
parent 37fc4c1316
commit cd4fb295e9
3 changed files with 2 additions and 2 deletions

BIN
dist/index.js generated vendored

Binary file not shown.

BIN
dist/index.js.map generated vendored

Binary file not shown.

View File

@ -62,8 +62,8 @@ class Kubernetes implements ProviderInterface {
const url = `http://${ip}/api/log`;
RemoteClientLogger.log(`Pushing logs to ${url}`);
// replace newlines with escaped newlines
logs = logs.replace(/\n/g, '\\n');
// logs to base64
logs = Buffer.from(logs).toString('base64');
const response = await CloudRunnerSystem.Run(`curl -X POST -d "${logs}" ${url}`, false, true);
RemoteClientLogger.log(`Pushed logs to ${url} ${response}`);
}