labctl: segments sur des bridges de l'hôte, routeurs et passerelle VRRP #2
All checks were successful
Tests / test (push) Successful in 3m46s
All checks were successful
Tests / test (push) Successful in 3m46s
Signed-off-by: GnomeZworc <nicolas.boufidjeline@g3e.fr>
This commit is contained in:
parent
e0de56a64f
commit
e9a0c19b72
24 changed files with 1766 additions and 578 deletions
|
|
@ -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]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue