push k8s logs to LOG SERVICE IP

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

BIN
dist/index.js generated vendored

Binary file not shown.

BIN
dist/index.js.map generated vendored

Binary file not shown.

View File

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