fix: no default fallback dns server

This commit is contained in:
Qiu Jian
2023-12-08 01:15:15 +08:00
parent 8fa8266009
commit 41f77abfc7
4 changed files with 9 additions and 15 deletions
-4
View File
@@ -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
+1 -3
View File
@@ -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 ""
}
+4 -4
View File
@@ -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"`
+4 -4
View File
@@ -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 + "}"
}
}