mirror of
https://github.com/rancher/os.git
synced 2025-09-01 14:48:55 +00:00
Remove DHCP override flag
This commit is contained in:
14
vendor/github.com/rancher/netconf/netconf_linux.go
generated
vendored
14
vendor/github.com/rancher/netconf/netconf_linux.go
generated
vendored
@@ -182,7 +182,7 @@ func ApplyNetworkConfigs(netCfg *NetworkConfig) error {
|
||||
return err
|
||||
}
|
||||
|
||||
func RunDhcp(netCfg *NetworkConfig, dhcpHostname bool) error {
|
||||
func RunDhcp(netCfg *NetworkConfig, setHostname, setDns bool) error {
|
||||
links, err := netlink.LinkList()
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -200,7 +200,7 @@ func RunDhcp(netCfg *NetworkConfig, dhcpHostname bool) error {
|
||||
for iface, args := range dhcpLinks {
|
||||
wg.Add(1)
|
||||
go func(iface, args string) {
|
||||
runDhcp(netCfg, iface, args, dhcpHostname)
|
||||
runDhcp(netCfg, iface, args, setHostname, setDns)
|
||||
wg.Done()
|
||||
}(iface, args)
|
||||
}
|
||||
@@ -209,7 +209,7 @@ func RunDhcp(netCfg *NetworkConfig, dhcpHostname bool) error {
|
||||
return err
|
||||
}
|
||||
|
||||
func runDhcp(netCfg *NetworkConfig, iface string, argstr string, dhcpHostname bool) {
|
||||
func runDhcp(netCfg *NetworkConfig, iface string, argstr string, setHostname, setDns bool) {
|
||||
log.Infof("Running DHCP on %s", iface)
|
||||
args := []string{}
|
||||
if argstr != "" {
|
||||
@@ -223,12 +223,12 @@ func runDhcp(netCfg *NetworkConfig, iface string, argstr string, dhcpHostname bo
|
||||
args = defaultDhcpArgs
|
||||
}
|
||||
|
||||
if netCfg.Dns.Override {
|
||||
args = append(args, "--nohook", "resolv.conf")
|
||||
if setHostname {
|
||||
args = append(args, "-e", "force_hostname=true")
|
||||
}
|
||||
|
||||
if dhcpHostname {
|
||||
args = append(args, "-e", "force_hostname=true")
|
||||
if !setDns {
|
||||
args = append(args, "--nohook", "resolv.conf")
|
||||
}
|
||||
|
||||
args = append(args, iface)
|
||||
|
1
vendor/github.com/rancher/netconf/types.go
generated
vendored
1
vendor/github.com/rancher/netconf/types.go
generated
vendored
@@ -26,7 +26,6 @@ type InterfaceConfig struct {
|
||||
}
|
||||
|
||||
type DnsConfig struct {
|
||||
Override bool `yaml:"override"`
|
||||
Nameservers []string `yaml:"nameservers,flow,omitempty"`
|
||||
Search []string `yaml:"search,flow,omitempty"`
|
||||
}
|
||||
|
Reference in New Issue
Block a user