From 51736eeec370dd9ac913d7a7c2cf592157222166 Mon Sep 17 00:00:00 2001 From: Graham McIntire Date: Sat, 24 Jan 2026 14:39:53 -0600 Subject: [PATCH] fix: use charlists for etcd endpoints The :eetcd Erlang library expects charlists, not binary strings. This was causing a FunctionClauseError in :lists.reverse/1 because it was receiving a binary string instead of a charlist. Error: (FunctionClauseError) no function clause matching in :lists.reverse/1 (stdlib 7.2) lists.erl:291: :lists.reverse("etcd-0.etcd...") Solution: Use ~c sigil to convert endpoint strings to charlists for the Erlang library to consume correctly. --- lib/towerops/monitoring/etcd_coordinator.ex | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/towerops/monitoring/etcd_coordinator.ex b/lib/towerops/monitoring/etcd_coordinator.ex index 1e66ffa0..344538e5 100644 --- a/lib/towerops/monitoring/etcd_coordinator.ex +++ b/lib/towerops/monitoring/etcd_coordinator.ex @@ -109,10 +109,11 @@ defmodule Towerops.Monitoring.EtcdCoordinator do defp connect_etcd do # Connect to etcd StatefulSet in Kubernetes + # eetcd is an Erlang library and expects charlists, not binary strings endpoints = [ - "etcd-0.etcd.towerops.svc.cluster.local:2379", - "etcd-1.etcd.towerops.svc.cluster.local:2379", - "etcd-2.etcd.towerops.svc.cluster.local:2379" + ~c"etcd-0.etcd.towerops.svc.cluster.local:2379", + ~c"etcd-1.etcd.towerops.svc.cluster.local:2379", + ~c"etcd-2.etcd.towerops.svc.cluster.local:2379" ] :eetcd.open(:towerops_etcd, endpoints)