[FIX] Changes made to database will now be reflected in the cluster
This commit is contained in:
parent
0a0f9c8463
commit
11f70087f1
6 changed files with 128 additions and 26 deletions
|
@ -9,6 +9,8 @@ import {
|
|||
import ExpressClientError, { sendError } from "../util/ExpressClientError.js";
|
||||
import { toggleServer } from "../k8s/k8s-server-control.js";
|
||||
import { checkAuthorization } from "../database/queries/server-queries.js";
|
||||
import { WARN } from "../util/logging.js";
|
||||
import modifyServerResources from "../k8s/server-modify.js";
|
||||
|
||||
const dnsRegex = new RegExp(
|
||||
`^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])(\.([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9]))*$`,
|
||||
|
@ -158,10 +160,15 @@ export async function getServer(req, res) {
|
|||
export async function modifyServer(req, res) {
|
||||
if (payloadFilter(req, res) !== "filtered") return;
|
||||
const serverSpec = req.body;
|
||||
if (!!serverSpec.host)
|
||||
WARN(
|
||||
"MODIFY",
|
||||
"Warning, hostname changing is not implimented yet! Please ask the developer if you'd like to see this added!",
|
||||
);
|
||||
try {
|
||||
await checkServerId(req.cairoId, serverSpec);
|
||||
const serverEntry = await modifyServerEntry(serverSpec);
|
||||
// await createServerResources(serverEntry);
|
||||
await modifyServerResources(serverEntry);
|
||||
res.sendStatus(200);
|
||||
} catch (e) {
|
||||
sendError(res)(e);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue