File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed
Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -8,15 +8,16 @@ import { Server } from './models/server';
88// Provisioning has a couple edgecases:
99// - It will only update existing entries, will not add new one
1010// - Only the fields in the below schema will be updated
11+ // - Set fields to null to unset them. Undefined means it won't be modified
1112
1213const serverProvisioningSchema = z . object ( {
1314 servers : z . array ( z . object ( {
1415 id : z . string ( ) ,
1516 name : z . string ( ) ,
16- ip : z . string ( ) . optional ( ) ,
17- ipList : z . array ( z . string ( ) ) . optional ( ) ,
18- port : z . coerce . number ( ) ,
19- health_check_port : z . coerce . number ( ) . optional ( )
17+ ip : z . string ( ) . nullable ( ) . optional ( ) ,
18+ ip_list : z . array ( z . string ( ) ) . default ( [ ] ) ,
19+ port : z . number ( ) ,
20+ health_check_port : z . number ( ) . nullable ( ) . optional ( )
2021 } ) )
2122} ) ;
2223
@@ -42,7 +43,7 @@ export async function handleServerProvisioning(): Promise<void> {
4243 $set : {
4344 _id : id ,
4445 service_name : server . name ,
45- ipList : server . ipList ,
46+ ip_list : server . ip_list ,
4647 ip : server . ip ,
4748 port : server . port ,
4849 health_check_port : server . health_check_port
You can’t perform that action at this time.
0 commit comments