Allow CNAME records when specified as MINIO_PUBLIC_IPS (#8662)

This is necessary for `m3` global bucket support
master
Harshavardhana 5 years ago committed by Nitish Tiwari
parent 63c3114657
commit c9c0d5eec2
  1. 1
      cmd/common-main.go
  2. 2
      cmd/config/etcd/dns/etcd_dns.go
  3. 22
      cmd/endpoint.go

@ -188,7 +188,6 @@ func handleCommonEnvVars() {
for _, addr := range addrs {
domainIPs.Add(addr)
}
continue
}
domainIPs.Add(endpoint)
}

@ -154,6 +154,8 @@ func (c *CoreDNS) list(key string) ([]SrvRecord, error) {
// Put - Adds DNS entries into etcd endpoint in CoreDNS etcd message format.
func (c *CoreDNS) Put(bucket string) error {
c.Delete(bucket) // delete any existing entries.
for ip := range c.domainIPs {
bucketMsg, err := newCoreDNSMsg(ip, c.domainPort, defaultTTL)
if err != nil {

@ -694,17 +694,23 @@ func updateDomainIPs(endPoints set.StringSet) {
continue
}
}
IPs, err := getHostIP(host)
if err != nil {
continue
}
IPsWithPort := IPs.ApplyFunc(func(ip string) string {
return net.JoinHostPort(ip, port)
})
if net.ParseIP(host) == nil {
IPs, err := getHostIP(host)
if err != nil {
continue
}
IPsWithPort := IPs.ApplyFunc(func(ip string) string {
return net.JoinHostPort(ip, port)
})
ipList = ipList.Union(IPsWithPort)
ipList = ipList.Union(IPsWithPort)
}
ipList.Add(net.JoinHostPort(host, port))
}
globalDomainIPs = ipList.FuncMatch(func(ip string, matchString string) bool {
host, _, err := net.SplitHostPort(ip)
if err != nil {

Loading…
Cancel
Save