f-41: subnet: export du préfixe dans la VRF, suppression refusée tant qu'une VM l'utilise #41
Signed-off-by: GnomeZworc <nicolas.boufidjeline@g3e.fr>
This commit is contained in:
parent
3c6852dc18
commit
fe27d45262
12 changed files with 253 additions and 2 deletions
|
|
@ -10,6 +10,7 @@ import (
|
|||
"git.g3e.fr/syonad/two/internal/netif"
|
||||
"git.g3e.fr/syonad/two/internal/netns"
|
||||
"git.g3e.fr/syonad/two/internal/state"
|
||||
"git.g3e.fr/syonad/two/internal/vpc"
|
||||
|
||||
"github.com/dgraph-io/badger/v4"
|
||||
)
|
||||
|
|
@ -37,6 +38,12 @@ func CreateSubnet(db *badger.DB, subnetName string, cfg *configuration.Config) e
|
|||
return err
|
||||
}
|
||||
|
||||
if d.mode == ModeVxlan {
|
||||
if err := vpc.ExportRoute(db, d.vpc, d.cidr); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
return state.Set(db, "subnet/"+subnetName, state.Running)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue