f-41: l3vni: routage des VPC sorti de vpc dans son propre paquet #41
Signed-off-by: GnomeZworc <nicolas.boufidjeline@g3e.fr>
This commit is contained in:
parent
472c2558fd
commit
87e97c8be1
18 changed files with 80 additions and 66 deletions
|
|
@ -8,7 +8,7 @@ import (
|
|||
"strings"
|
||||
|
||||
dispatcher "git.g3e.fr/syonad/two/internal/dispatcher/agent"
|
||||
"git.g3e.fr/syonad/two/internal/vpc"
|
||||
"git.g3e.fr/syonad/two/internal/l3vni"
|
||||
"git.g3e.fr/syonad/two/pkg/db/kv"
|
||||
)
|
||||
|
||||
|
|
@ -82,7 +82,7 @@ func (s *Server) postVpc(w http.ResponseWriter, r *http.Request) {
|
|||
}
|
||||
cmd := dispatcher.CreateVPCCommand{Name: req.Name, CIDR: req.CIDR}
|
||||
if req.L3VNI != nil {
|
||||
if err := vpc.ValidL3VNI(*req.L3VNI); err != nil {
|
||||
if err := l3vni.Valid(*req.L3VNI); err != nil {
|
||||
w.WriteHeader(http.StatusBadRequest)
|
||||
json.NewEncoder(w).Encode(ErrorResponse{Error: err.Error()})
|
||||
return
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue