mirror of
https://github.com/PretendoNetwork/account.git
synced 2026-03-21 17:44:49 -05:00
Merge pull request #319 from PretendoNetwork/fix/provisioning-updates
Fix/provisioning updates
This commit is contained in:
commit
d99d02cb0a
|
|
@ -8,15 +8,17 @@ import { Server } from './models/server';
|
|||
// Provisioning has a couple edgecases:
|
||||
// - It will only update existing entries, will not add new one
|
||||
// - Only the fields in the below schema will be updated
|
||||
// - Set fields to null to unset them. Undefined means it won't be modified
|
||||
|
||||
const serverProvisioningSchema = z.object({
|
||||
servers: z.array(z.object({
|
||||
id: z.string(),
|
||||
name: z.string(),
|
||||
ip: z.string().optional(),
|
||||
ipList: z.array(z.string()).optional(),
|
||||
port: z.coerce.number(),
|
||||
health_check_port: z.coerce.number().optional()
|
||||
name: z.string().optional(),
|
||||
ip: z.string().nullable().optional(),
|
||||
ip_list: z.array(z.string()).optional(),
|
||||
port: z.number().optional(),
|
||||
health_check_port: z.number().nullable().optional(),
|
||||
aes_key: z.string().optional()
|
||||
}))
|
||||
});
|
||||
|
||||
|
|
@ -42,10 +44,11 @@ export async function handleServerProvisioning(): Promise<void> {
|
|||
$set: {
|
||||
_id: id,
|
||||
service_name: server.name,
|
||||
ipList: server.ipList,
|
||||
ip_list: server.ip_list,
|
||||
ip: server.ip,
|
||||
port: server.port,
|
||||
health_check_port: server.health_check_port
|
||||
health_check_port: server.health_check_port,
|
||||
aes_key: server.aes_key
|
||||
}
|
||||
});
|
||||
if (!result) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user