f-56: agent: MTU unique network.mtu_vm, underlay à 9000 contrôlé à la création, option DHCP 26 et host_mtu #56
Signed-off-by: GnomeZworc <nicolas.boufidjeline@g3e.fr>
This commit is contained in:
parent
d1b50d546c
commit
8cb5117cb2
37 changed files with 518 additions and 24 deletions
|
|
@ -55,6 +55,7 @@ type Config struct {
|
|||
Enabled bool `mapstructure:"enabled"`
|
||||
IntervalSeconds int `mapstructure:"interval_seconds"`
|
||||
} `mapstructure:"watchdog"`
|
||||
Network Network `mapstructure:"network"`
|
||||
BGP BGP `mapstructure:"bgp"`
|
||||
DefaultInterface string `mapstructure:"default_interface"`
|
||||
Interfaces map[string]string `mapstructure:"interfaces"`
|
||||
|
|
@ -90,6 +91,9 @@ func LoadConfig(path string) (*Config, error) {
|
|||
v.SetDefault("default_interface", "br-000000")
|
||||
v.SetDefault("logger.level", "info")
|
||||
v.SetDefault("logger.debug", false)
|
||||
v.SetDefault("network.mtu_vm", MTUVM)
|
||||
v.SetDefault("network.allow_mtu_vm_below_1500", false)
|
||||
v.SetDefault("network.allow_mtu_underlay_below_9000", false)
|
||||
|
||||
if err := v.ReadInConfig(); err != nil && !errors.Is(err, os.ErrNotExist) {
|
||||
return nil, fmt.Errorf("read %s: %w", path, err)
|
||||
|
|
@ -99,6 +103,9 @@ func LoadConfig(path string) (*Config, error) {
|
|||
if err := v.Unmarshal(&cfg); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if err := cfg.Network.Validate(); err != nil {
|
||||
return nil, fmt.Errorf("%s: %w", path, err)
|
||||
}
|
||||
|
||||
return &cfg, nil
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue