Minor Adjustments

This commit is contained in:
Dunemask 2023-03-19 13:53:37 -04:00 committed by dunemask
parent ba8e6ded26
commit a90c28dd76
60 changed files with 8240 additions and 8 deletions

View file

@ -0,0 +1,20 @@
import cp from "node:child_process";
import fs from "node:fs";
import path from "node:path";
import { jobBuilder, createFile, deleteFile } from "./k8s-common.js";
// Constants
const internalEngine = path.resolve("./lib/jobs/k8s/k8s-internal-engine.js");
// Functions
const applyFileInternally = (filePath) => {
const job = fs.readFileSync(filePath, { encoding: "utf8" });
cp.fork(internalEngine, [job]);
};
export default async function createJobInternally(jobRequest) {
const job = jobBuilder(jobRequest);
const filePath = createFile(job);
applyFileInternally(filePath);
deleteFile(filePath);
}