mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-10-30 18:23:35 +08:00
fix: no default fallback dns server
This commit is contained in:
@@ -20,10 +20,6 @@ import (
|
||||
"yunion.io/x/cloudmux/pkg/apis/compute"
|
||||
)
|
||||
|
||||
const (
|
||||
DefaultDNSServers = "223.5.5.5,223.6.6.6"
|
||||
)
|
||||
|
||||
const (
|
||||
// # DEFAULT_BANDWIDTH = options.default_bandwidth
|
||||
MAX_BANDWIDTH = 100000
|
||||
|
||||
@@ -408,9 +408,7 @@ func (self *SNetwork) GetDNS(zoneName string) string {
|
||||
if len(options.Options.DNSServer) > 0 {
|
||||
return options.Options.DNSServer
|
||||
}
|
||||
if options.Options.EnableDefaultDNS {
|
||||
return api.DefaultDNSServers
|
||||
}
|
||||
|
||||
return ""
|
||||
}
|
||||
|
||||
|
||||
@@ -25,10 +25,10 @@ import (
|
||||
type ComputeOptions struct {
|
||||
PortV2 int `help:"Listening port for region V2"`
|
||||
|
||||
DNSServer string `help:"Address of DNS server"`
|
||||
DNSDomain string `help:"Domain suffix for virtual servers"`
|
||||
DNSResolvers []string `help:"Upstream DNS resolvers"`
|
||||
EnableDefaultDNS bool `help:"Enable default DNS if dns server not specific" default:"true"`
|
||||
DNSServer string `help:"Address of DNS server"`
|
||||
DNSDomain string `help:"Domain suffix for virtual servers"`
|
||||
DNSResolvers []string `help:"Upstream DNS resolvers"`
|
||||
// EnableDefaultDNS bool `help:"Enable default DNS if dns server not specific" default:"true"`
|
||||
|
||||
DefaultCPUOvercommitBound float32 `default:"8.0" help:"Default cpu overcommit bound for host, default to 8"`
|
||||
DefaultMemoryOvercommitBound float32 `default:"1.0" help:"Default memory overcommit bound for host, default to 1"`
|
||||
|
||||
@@ -341,10 +341,9 @@ func (keeper *OVNNorthboundKeeper) ClaimNetwork(ctx context.Context, network *ag
|
||||
dnsSrvs = strings.Join(dns, ",")
|
||||
}
|
||||
}
|
||||
if len(dnsSrvs) == 0 {
|
||||
dnsSrvs = apis.DefaultDNSServers
|
||||
if len(dnsSrvs) > 0 {
|
||||
dhcpopts.Options["dns_server"] = "{" + dnsSrvs + "}"
|
||||
}
|
||||
dhcpopts.Options["dns_server"] = "{" + dnsSrvs + "}"
|
||||
}
|
||||
{
|
||||
ntpSrvs := ""
|
||||
@@ -360,7 +359,8 @@ func (keeper *OVNNorthboundKeeper) ClaimNetwork(ctx context.Context, network *ag
|
||||
}
|
||||
}
|
||||
if len(ntpSrvs) > 0 {
|
||||
dhcpopts.Options["ntp_server"] = "{" + ntpSrvs + "}"
|
||||
// bug on OVN, should not use ntp server
|
||||
// dhcpopts.Options["ntp_server"] = "{" + ntpSrvs + "}"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user