f-81: api: default_route sans gateway réservé au mode bridge #81
Signed-off-by: GnomeZworc <nicolas.boufidjeline@g3e.fr>
This commit is contained in:
parent
8429dfd7e1
commit
dd9844284d
3 changed files with 49 additions and 3 deletions
|
|
@ -78,6 +78,11 @@ func (s *Server) postSubnet(w http.ResponseWriter, r *http.Request) {
|
|||
json.NewEncoder(w).Encode(ErrorResponse{Error: "interface_ip is computed for vxlan subnets, do not set it"})
|
||||
return
|
||||
}
|
||||
if req.DefaultRoute && req.Gateway == "" && req.Mode != subnet.ModeBridge {
|
||||
w.WriteHeader(http.StatusBadRequest)
|
||||
json.NewEncoder(w).Encode(ErrorResponse{Error: "default_route without gateway is only allowed for bridge subnets: the host gateway is not on the subnet"})
|
||||
return
|
||||
}
|
||||
cmd := dispatcher.CreateSubnetCommand{
|
||||
Name: req.Name,
|
||||
VPC: req.VPC,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue