1
0
mirror of https://github.com/rancher/os.git synced 2025-09-05 00:37:12 +00:00

Add dhcp timeout parameter

This commit is contained in:
Jason-ZW
2018-10-22 10:11:12 +08:00
committed by niusmallnan
parent a088811de9
commit ef663b4e70
7 changed files with 31 additions and 7 deletions

View File

@@ -284,12 +284,18 @@ func getDatasources(datasources []string) []datasource.Datasource {
}
func enableDoLinkLocal() {
cfg := rancherConfig.LoadConfig()
dhcpTimeout := cfg.Rancher.Defaults.Network.DHCPTimeout
if cfg.Rancher.Network.DHCPTimeout > 0 {
dhcpTimeout = cfg.Rancher.Network.DHCPTimeout
}
_, err := netconf.ApplyNetworkConfigs(&netconf.NetworkConfig{
Interfaces: map[string]netconf.InterfaceConfig{
"eth0": {
IPV4LL: true,
},
},
DHCPTimeout: dhcpTimeout,
}, false, false)
if err != nil {
log.Errorf("Failed to apply link local on eth0: %v", err)