[FEATURE] Initial Anti-Storage

This commit is contained in:
Dunemask 2024-01-23 14:50:41 -07:00
parent b84fba6153
commit 9f0689f6a4
6 changed files with 95 additions and 57 deletions

View file

@ -22,7 +22,7 @@ export async function createServerEntry(serverSpec) {
serverType: server_type,
cpu, // TODO: Ignored for now by the K8S manifests
memory,
storage,
storage: storage_val,
extraPorts: extra_ports,
backupHost: backup_host,
backupBucket: backup_bucket_path,
@ -30,6 +30,7 @@ export async function createServerEntry(serverSpec) {
backupKey: backup_key,
backupInterval: backup_interval,
} = serverSpec;
var q = insertQuery(table, {
name,
host,
@ -37,7 +38,7 @@ export async function createServerEntry(serverSpec) {
server_type,
cpu, // TODO: Ignored for now by the K8S manifests
memory,
storage,
storage: !storage_val || storage_val === "0" ? null : storage_val, // 0, undefined, null, or "0" becomes null
extra_ports,
backup_enabled: !!backup_interval ? true : null, // We already verified the payload, so any backup key will work
backup_host,