refactor(network/ovn): relocate nbdb model package from services/vpcd

Phase 4 / mulga-siv-125.6 Slice A. Pure import rename, no logic change.

The OVN Northbound DB model (LogicalSwitch, LogicalRouter, DHCPOptions,
etc.) lived under services/vpcd/nbdb/ because that was the original home
of every OVN caller. After Phase 1+2 the L1 client (network/ovn) and all
L3/L5 managers (network/policy, network/external, network/topology,
network/reconcile) became the primary callers — 8 importers in network/*
vs 2 in services/vpcd/. The directory move puts the schema model where
its consumers are, and unblocks deleting services/vpcd/ entirely once
the subscriber/launcher relocations land (Slices B–D).
This commit is contained in:
joshsiv-mulga
2026-05-25 13:45:34 +10:00
parent 688c9b17ab
commit bcad478a4b
19 changed files with 18 additions and 18 deletions
+1 -1
View File
@@ -8,9 +8,9 @@ import (
"github.com/stretchr/testify/require"
"github.com/mulgadc/spinifex/spinifex/network/ovn/mock"
"github.com/mulgadc/spinifex/spinifex/network/ovn/nbdb"
"github.com/mulgadc/spinifex/spinifex/network/policy"
"github.com/mulgadc/spinifex/spinifex/network/topology"
"github.com/mulgadc/spinifex/spinifex/services/vpcd/nbdb"
)
func TestNewEIPManager_RejectsNilNAT(t *testing.T) {
+1 -1
View File
@@ -7,9 +7,9 @@ import (
"log/slog"
"github.com/mulgadc/spinifex/spinifex/network/ovn"
"github.com/mulgadc/spinifex/spinifex/network/ovn/nbdb"
"github.com/mulgadc/spinifex/spinifex/network/policy"
"github.com/mulgadc/spinifex/spinifex/network/topology"
"github.com/mulgadc/spinifex/spinifex/services/vpcd/nbdb"
)
// FlowsBarrier blocks until ovn-northd has compiled NB → SB and every
+1 -1
View File
@@ -9,9 +9,9 @@ import (
"github.com/stretchr/testify/require"
"github.com/mulgadc/spinifex/spinifex/network/ovn/mock"
"github.com/mulgadc/spinifex/spinifex/network/ovn/nbdb"
"github.com/mulgadc/spinifex/spinifex/network/policy"
"github.com/mulgadc/spinifex/spinifex/network/topology"
"github.com/mulgadc/spinifex/spinifex/services/vpcd/nbdb"
)
func seedVPCRouter(t *testing.T, m *mock.Client, vpcID, cidr string) {
+1 -1
View File
@@ -8,9 +8,9 @@ import (
"github.com/stretchr/testify/require"
"github.com/mulgadc/spinifex/spinifex/network/ovn/mock"
"github.com/mulgadc/spinifex/spinifex/network/ovn/nbdb"
"github.com/mulgadc/spinifex/spinifex/network/policy"
"github.com/mulgadc/spinifex/spinifex/network/topology"
"github.com/mulgadc/spinifex/spinifex/services/vpcd/nbdb"
)
func TestNewNATGWManager_RejectsNilNAT(t *testing.T) {
+1 -1
View File
@@ -9,8 +9,8 @@ import (
"github.com/stretchr/testify/require"
"github.com/mulgadc/spinifex/spinifex/network/ovn/mock"
"github.com/mulgadc/spinifex/spinifex/network/ovn/nbdb"
"github.com/mulgadc/spinifex/spinifex/network/topology"
"github.com/mulgadc/spinifex/spinifex/services/vpcd/nbdb"
)
func TestFindPool_AZBeatsRegionBeatsUnscoped(t *testing.T) {
+1 -1
View File
@@ -7,7 +7,7 @@ import (
"context"
"errors"
"github.com/mulgadc/spinifex/spinifex/services/vpcd/nbdb"
"github.com/mulgadc/spinifex/spinifex/network/ovn/nbdb"
)
// ErrNATNotFound is returned by DeleteNAT / DeleteNATByExternalIP when the
+1 -1
View File
@@ -6,7 +6,7 @@ import (
"log/slog"
"slices"
"github.com/mulgadc/spinifex/spinifex/services/vpcd/nbdb"
"github.com/mulgadc/spinifex/spinifex/network/ovn/nbdb"
"github.com/ovn-kubernetes/libovsdb/client"
"github.com/ovn-kubernetes/libovsdb/model"
"github.com/ovn-kubernetes/libovsdb/ovsdb"
+1 -1
View File
@@ -8,7 +8,7 @@ import (
"sync"
"github.com/mulgadc/spinifex/spinifex/network/ovn"
"github.com/mulgadc/spinifex/spinifex/services/vpcd/nbdb"
"github.com/mulgadc/spinifex/spinifex/network/ovn/nbdb"
"github.com/mulgadc/spinifex/spinifex/utils"
)
+1 -1
View File
@@ -4,7 +4,7 @@ import (
"context"
"testing"
"github.com/mulgadc/spinifex/spinifex/services/vpcd/nbdb"
"github.com/mulgadc/spinifex/spinifex/network/ovn/nbdb"
)
func TestClient_DeleteAllNATsByExternalIP(t *testing.T) {
@@ -7,7 +7,7 @@
// To regenerate from the full OVN NB schema (requires OVN installed):
//
// go install github.com/ovn-kubernetes/libovsdb/cmd/modelgen@latest
// modelgen -p nbdb -o spinifex/services/vpcd/nbdb /usr/share/ovn/ovn-nb.ovsschema
// modelgen -p nbdb -o spinifex/network/ovn/nbdb /usr/share/ovn/ovn-nb.ovsschema
package nbdb
import "github.com/ovn-kubernetes/libovsdb/model"
+1 -1
View File
@@ -7,8 +7,8 @@ import (
"log/slog"
"github.com/mulgadc/spinifex/spinifex/network/ovn"
"github.com/mulgadc/spinifex/spinifex/network/ovn/nbdb"
"github.com/mulgadc/spinifex/spinifex/network/topology"
"github.com/mulgadc/spinifex/spinifex/services/vpcd/nbdb"
)
// EIPSpec is a 1:1 Elastic IP NAT (dnat_and_snat) attaching ExternalIP to
+1 -1
View File
@@ -9,8 +9,8 @@ import (
"github.com/mulgadc/spinifex/spinifex/network/host"
"github.com/mulgadc/spinifex/spinifex/network/ovn/mock"
"github.com/mulgadc/spinifex/spinifex/network/ovn/nbdb"
"github.com/mulgadc/spinifex/spinifex/network/topology"
"github.com/mulgadc/spinifex/spinifex/services/vpcd/nbdb"
)
func seedRouter(t *testing.T, m *mock.Client, vpcID string) string {
+1 -1
View File
@@ -6,8 +6,8 @@ import (
"net/netip"
"github.com/mulgadc/spinifex/spinifex/network/ovn"
"github.com/mulgadc/spinifex/spinifex/network/ovn/nbdb"
"github.com/mulgadc/spinifex/spinifex/network/topology"
"github.com/mulgadc/spinifex/spinifex/services/vpcd/nbdb"
)
// defaultRoutePrefix is the IPv4 default-route prefix used by AddDefaultRoute
+1 -1
View File
@@ -9,8 +9,8 @@ import (
"github.com/stretchr/testify/require"
"github.com/mulgadc/spinifex/spinifex/network/ovn/mock"
"github.com/mulgadc/spinifex/spinifex/network/ovn/nbdb"
"github.com/mulgadc/spinifex/spinifex/network/topology"
"github.com/mulgadc/spinifex/spinifex/services/vpcd/nbdb"
)
func findRoute(m *mock.Client, prefix string) *nbdb.LogicalRouterStaticRoute {
+1 -1
View File
@@ -6,8 +6,8 @@ import (
"log/slog"
"net/netip"
"github.com/mulgadc/spinifex/spinifex/network/ovn/nbdb"
"github.com/mulgadc/spinifex/spinifex/network/topology"
"github.com/mulgadc/spinifex/spinifex/services/vpcd/nbdb"
"github.com/mulgadc/spinifex/spinifex/utils"
)
+1 -1
View File
@@ -10,7 +10,7 @@ import (
"strings"
"github.com/mulgadc/spinifex/spinifex/network/ovn"
"github.com/mulgadc/spinifex/spinifex/services/vpcd/nbdb"
"github.com/mulgadc/spinifex/spinifex/network/ovn/nbdb"
"github.com/mulgadc/spinifex/spinifex/utils"
)
+1 -1
View File
@@ -12,9 +12,9 @@ import (
"time"
"github.com/mulgadc/spinifex/spinifex/network/external"
"github.com/mulgadc/spinifex/spinifex/network/ovn/nbdb"
"github.com/mulgadc/spinifex/spinifex/network/policy"
"github.com/mulgadc/spinifex/spinifex/network/topology"
"github.com/mulgadc/spinifex/spinifex/services/vpcd/nbdb"
"github.com/mulgadc/spinifex/spinifex/types"
"github.com/mulgadc/spinifex/spinifex/utils"
"github.com/nats-io/nats.go"
+1 -1
View File
@@ -10,8 +10,8 @@ import (
"testing"
"time"
"github.com/mulgadc/spinifex/spinifex/network/ovn/nbdb"
"github.com/mulgadc/spinifex/spinifex/network/topology"
"github.com/mulgadc/spinifex/spinifex/services/vpcd/nbdb"
"github.com/mulgadc/spinifex/spinifex/testutil"
"github.com/mulgadc/spinifex/spinifex/types"
"github.com/nats-io/nats-server/v2/server"