mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-21 06:09:39 +08:00
region: add one random config if user input net config is empty when create server (#379)
This commit is contained in:
@@ -1009,6 +1009,10 @@ func (manager *SGuestManager) ValidateCreateData(ctx context.Context, userCred m
|
||||
}
|
||||
}
|
||||
|
||||
// HACK: if input networks is empty, add one random network config
|
||||
if len(input.Networks) == 0 {
|
||||
input.Networks = append(input.Networks, &api.NetworkConfig{Exit: false})
|
||||
}
|
||||
netArray := input.Networks
|
||||
for idx := 0; idx < len(netArray); idx += 1 {
|
||||
netConfig, err := parseNetworkInfo(userCred, netArray[idx])
|
||||
|
||||
Reference in New Issue
Block a user