libnetwork/drivers/macvlan, ipvlan: remove networkTable, endpointTable

These types were just a straight map[string]XXX, with no methods or other
properties attached.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn
2025-10-19 13:51:50 +02:00
parent bf7277f8fe
commit aec6e7f7b6
4 changed files with 8 additions and 16 deletions

View File

@@ -30,12 +30,8 @@ const (
flagVepa = "vepa" // ipvlan flag vepa
)
type endpointTable map[string]*endpoint
type networkTable map[string]*network
type driver struct {
networks networkTable
networks map[string]*network
sync.Once
sync.Mutex
store *datastore.Store
@@ -54,7 +50,7 @@ type endpoint struct {
type network struct {
id string
endpoints endpointTable
endpoints map[string]*endpoint
driver *driver
config *configuration
sync.Mutex
@@ -64,7 +60,7 @@ type network struct {
func Register(r driverapi.Registerer, store *datastore.Store) error {
d := &driver{
store: store,
networks: networkTable{},
networks: map[string]*network{},
}
if err := d.initStore(); err != nil {
return err

View File

@@ -113,7 +113,7 @@ func (d *driver) createNetwork(config *configuration) (bool, error) {
n := &network{
id: config.ID,
driver: d,
endpoints: endpointTable{},
endpoints: map[string]*endpoint{},
config: config,
}
// add the network

View File

@@ -24,12 +24,8 @@ const (
driverModeOpt = "macvlan_mode" // macvlan mode ux opt suffix
)
type endpointTable map[string]*endpoint
type networkTable map[string]*network
type driver struct {
networks networkTable
networks map[string]*network
sync.Once
sync.Mutex
store *datastore.Store
@@ -48,7 +44,7 @@ type endpoint struct {
type network struct {
id string
endpoints endpointTable
endpoints map[string]*endpoint
driver *driver
config *configuration
sync.Mutex
@@ -58,7 +54,7 @@ type network struct {
func Register(r driverapi.Registerer, store *datastore.Store) error {
d := &driver{
store: store,
networks: networkTable{},
networks: map[string]*network{},
}
if err := d.initStore(); err != nil {
return err

View File

@@ -131,7 +131,7 @@ func (d *driver) createNetwork(config *configuration) (bool, error) {
d.addNetwork(&network{
id: config.ID,
driver: d,
endpoints: endpointTable{},
endpoints: map[string]*endpoint{},
config: config,
})
}