f-21: code: swap from interface only to full conf

Signed-off-by: GnomeZworc <nicolas.boufidjeline@g3e.fr>
This commit is contained in:
GnomeZworc 2026-04-21 21:32:59 +02:00
commit 8724570c81
Signed by: nicolas.boufideline
GPG key ID: 4406BBBF8845D632
4 changed files with 16 additions and 13 deletions

View file

@ -1,6 +1,7 @@
package dispatcher
import (
configuration "git.g3e.fr/syonad/two/internal/config/agent"
"git.g3e.fr/syonad/two/internal/vpc"
"git.g3e.fr/syonad/two/pkg/db/kv"
"github.com/dgraph-io/badger/v4"
@ -10,7 +11,7 @@ type CreateVPCCommand struct {
Name string
}
func (c CreateVPCCommand) Execute(db *badger.DB, _ map[string]string) error {
func (c CreateVPCCommand) Execute(db *badger.DB, _ *configuration.Config) error {
kv.AddInDB(db, "vpc/"+c.Name+"/state", "creating")
return vpc.CreateVPC(db, c.Name)
}
@ -19,7 +20,7 @@ type DeleteVPCCommand struct {
Name string
}
func (c DeleteVPCCommand) Execute(db *badger.DB, _ map[string]string) error {
func (c DeleteVPCCommand) Execute(db *badger.DB, _ *configuration.Config) error {
kv.AddInDB(db, "vpc/"+c.Name+"/state", "deleting")
if err := vpc.DeleteVPC(db, c.Name); err != nil {
return err