Skip to content

Commit 787f388

Browse files
committed
Simplify construction of DNS resource name
The default DNS search space in Kube already prioritizes the namespace.
1 parent 86f30e2 commit 787f388

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

mem3_helper.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,9 @@
88
import dns.resolver
99

1010
def discover_peers_dns(retries=5):
11-
# Assumes svc.cluster.local is in the DNS search space ...
12-
resource = '_couchdb._tcp.{0}.{1}'.format(
13-
os.environ.get("COUCHDB_SERVICE", "couchdb"),
14-
os.environ.get("POD_NAMESPACE", "default")
11+
# Assumes <namespace>.svc.cluster.local is in the DNS search space ...
12+
resource = '_couchdb._tcp.{0}'.format(
13+
os.environ.get("COUCHDB_SERVICE", "couchdb")
1514
)
1615
if retries > 0:
1716
try:

0 commit comments

Comments
 (0)