From 3af70b36fda4c900e92d33f8c2970aee319f7dc5 Mon Sep 17 00:00:00 2001 From: Harshavardhana Date: Mon, 30 Dec 2019 17:11:47 -0800 Subject: [PATCH] Disallow creating buckets even with different domains (#8716) If two distinct clusters are started with different domains along with single common domain, this situation was leading to conflicting buckets getting created on different clusters To avoid this do not prematurely error out if the key has no entries, let the caller decide on which entry matches and which entry is valid. This allows support for MINIO_DOMAIN with one common domain, but each cluster may have their own domains. Fixes #8705 --- cmd/config/etcd/dns/etcd_dns.go | 6 ------ 1 file changed, 6 deletions(-) diff --git a/cmd/config/etcd/dns/etcd_dns.go b/cmd/config/etcd/dns/etcd_dns.go index ba0f6b0e9..58ee48fc3 100644 --- a/cmd/config/etcd/dns/etcd_dns.go +++ b/cmd/config/etcd/dns/etcd_dns.go @@ -117,9 +117,6 @@ func (c *CoreDNS) list(key string) ([]SrvRecord, error) { if err != nil { return nil, err } - if r.Count == 0 { - return nil, ErrNoEntriesFound - } } var srvRecords []SrvRecord @@ -143,9 +140,6 @@ func (c *CoreDNS) list(key string) ([]SrvRecord, error) { srvRecords = append(srvRecords, srvRecord) } - if len(srvRecords) == 0 { - return nil, ErrNoEntriesFound - } sort.Slice(srvRecords, func(i int, j int) bool { return srvRecords[i].Key < srvRecords[j].Key })