@ -127,41 +127,37 @@ export const getFinalValues = (
) : INetworkNodeItem = > {
) : INetworkNodeItem = > {
const { labels , driver , configurations , options } = values ;
const { labels , driver , configurations , options } = values ;
return lodash . merge (
return {
lodash . cloneDeep ( previous ) || {
key : "network" ,
key : "network" ,
type : "NETWORK" ,
type : "NETWORK" ,
inputs : previous?.inputs ? ? [ ] ,
inputs : [ ] ,
outputs : previous?.outputs ? ? [ ] ,
outputs : [ ] ,
config : ( previous as any ) ? . config ? ? { } ,
config : { }
canvasConfig : {
node_name : values.entryName
} ,
} ,
{
networkConfig : {
canvasConfig : {
name : values.networkName ,
node_name : values.entryName
ipam : {
} ,
driver ,
networkConfig : {
config : configurations.map ( ( configuration ) = > ( {
name : values.networkName ,
subnet : configuration.subnet ,
ipam : {
ip_range : configuration.ipRange ,
driver ,
gateway : configuration.gateway ,
config : configurations.map ( ( configuration ) = > ( {
aux_addresses : Object.fromEntries (
subnet : configuration.subnet ,
configuration . auxAddresses . map ( ( auxAddress ) = > [
ip_range : configuration.ipRange ,
auxAddress . hostName ,
gateway : configuration.gateway ,
auxAddress . ipAddress
aux_addresses : Object.fromEntries (
] )
configuration . auxAddresses . map ( ( auxAddress ) = > [
auxAddress . hostName ,
auxAddress . ipAddress
] )
)
} ) ) ,
options : Object.fromEntries (
options . map ( ( option ) = > [ option . key , option . value ] )
)
)
} ,
} ) ) ,
label s: Object.fromEntries (
options : Object.fromEntries (
labels. map ( ( label ) = > [ label . key , label . value ] )
options . map ( ( option ) = > [ option . key , option . value ] )
)
)
}
} ,
labels : Object.fromEntries (
labels . map ( ( label ) = > [ label . key , label . value ] )
)
}
}
) as any ;
} as any ;
} ;
} ;