f-41: l3vni: suppression d'une VPC routée sans section bgp #41
Signed-off-by: GnomeZworc <nicolas.boufidjeline@g3e.fr>
This commit is contained in:
parent
7ec298fcc1
commit
0679639b95
9 changed files with 56 additions and 28 deletions
|
|
@ -3,7 +3,6 @@ package vpc
|
|||
import (
|
||||
"strings"
|
||||
|
||||
configuration "git.g3e.fr/syonad/two/internal/config/agent"
|
||||
"git.g3e.fr/syonad/two/internal/l3vni"
|
||||
"git.g3e.fr/syonad/two/internal/netif"
|
||||
"git.g3e.fr/syonad/two/internal/netns"
|
||||
|
|
@ -12,13 +11,13 @@ import (
|
|||
"github.com/dgraph-io/badger/v4"
|
||||
)
|
||||
|
||||
func DeleteVPC(db *badger.DB, name string, cfg *configuration.Config) error {
|
||||
func DeleteVPC(db *badger.DB, name string) error {
|
||||
if current, err := state.Get(db, "vpc/"+name); err != nil {
|
||||
return err
|
||||
} else if current == state.Deleting {
|
||||
vpcID := strings.SplitN(name, "-", 2)[1]
|
||||
|
||||
if err := l3vni.Delete(db, name, cfg); err != nil {
|
||||
if err := l3vni.Delete(db, name); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue