mirror of
https://github.com/rancher/os.git
synced 2025-09-01 14:48:55 +00:00
If DNS override is set, pass --nohook resolv.conf
to dhcpd
This commit is contained in:
8
vendor/github.com/rancher/netconf/netconf_linux.go
generated
vendored
8
vendor/github.com/rancher/netconf/netconf_linux.go
generated
vendored
@@ -187,7 +187,7 @@ func ApplyNetworkConfigs(netCfg *NetworkConfig) error {
|
||||
for iface, args := range dhcpLinks {
|
||||
wg.Add(1)
|
||||
go func(iface, args string) {
|
||||
runDhcp(iface, args)
|
||||
runDhcp(netCfg, iface, args)
|
||||
wg.Done()
|
||||
}(iface, args)
|
||||
}
|
||||
@@ -197,7 +197,7 @@ func ApplyNetworkConfigs(netCfg *NetworkConfig) error {
|
||||
return err
|
||||
}
|
||||
|
||||
func runDhcp(iface string, argstr string) {
|
||||
func runDhcp(netCfg *NetworkConfig, iface string, argstr string) {
|
||||
log.Infof("Running DHCP on %s", iface)
|
||||
args := []string{}
|
||||
if argstr != "" {
|
||||
@@ -211,6 +211,10 @@ func runDhcp(iface string, argstr string) {
|
||||
args = defaultDhcpArgs
|
||||
}
|
||||
|
||||
if netCfg.Dns.Override {
|
||||
args = append(args, "--nohook", "resolv.conf")
|
||||
}
|
||||
|
||||
args = append(args, iface)
|
||||
cmd := exec.Command(args[0], args[1:]...)
|
||||
cmd.Stdout = os.Stdout
|
||||
|
Reference in New Issue
Block a user