labctl: segments sur des bridges de l'hôte, routeurs et passerelle VRRP #2
All checks were successful
Tests / test (push) Successful in 3m46s

Signed-off-by: GnomeZworc <nicolas.boufidjeline@g3e.fr>
This commit is contained in:
GnomeZworc 2026-10-13 09:57:09 +02:00
commit e9a0c19b72
Signed by: nicolas.boufideline
GPG key ID: 4406BBBF8845D632
24 changed files with 1766 additions and 578 deletions

View file

@ -11,7 +11,7 @@ import (
)
const (
RoleSwitch = "switch"
RoleRouter = "router"
RoleRR = "rr"
RoleHost = "host"
@ -32,10 +32,12 @@ type Image struct {
}
type Segment struct {
Name string
Switch string
CIDR string
MTU int
Name string
Routers []string
CIDR string
MTU int
legacySwitch string
}
type Node struct {
@ -61,9 +63,10 @@ type fileImage struct {
}
type fileSegment struct {
Switch string `yaml:"switch"`
CIDR string `yaml:"cidr"`
MTU int `yaml:"mtu"`
Routers []string `yaml:"routers"`
CIDR string `yaml:"cidr"`
MTU int `yaml:"mtu"`
Switch string `yaml:"switch"`
}
type fileNode struct {
@ -145,7 +148,7 @@ func Parse(data []byte) (*Topology, error) {
if mtu == 0 {
mtu = DefaultMTU
}
t.Segments = append(t.Segments, Segment{Name: name, Switch: s.Switch, CIDR: s.CIDR, MTU: mtu})
t.Segments = append(t.Segments, Segment{Name: name, Routers: s.Routers, CIDR: s.CIDR, MTU: mtu, legacySwitch: s.Switch})
}
for _, name := range order["nodes"] {
n := f.Nodes[name]