From af508f69fe9aa8346c6bac98c1c8be17ef989337 Mon Sep 17 00:00:00 2001 From: Ben Iofel Date: Wed, 31 Jul 2024 20:10:46 -0400 Subject: [PATCH] updates --- internal/flypg/readonly.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/flypg/readonly.go b/internal/flypg/readonly.go index a714c254..3fe424bf 100644 --- a/internal/flypg/readonly.go +++ b/internal/flypg/readonly.go @@ -70,7 +70,7 @@ func BroadcastReadonlyChange(ctx context.Context, n *Node, enabled bool) error { for _, member := range members { if member.Role == PrimaryRoleName { - endpoint := fmt.Sprintf("http://[%s]:5500/%s", member.Hostname, target) + endpoint := fmt.Sprintf("http://%s:5500/%s", fmt.Sprintf("%s.vm.%s.internal", member.Hostname, n.AppName), target) resp, err := http.Get(endpoint) if err != nil { log.Printf("[WARN] Failed to broadcast readonly state change to member %s: %s", member.Hostname, err) @@ -85,7 +85,7 @@ func BroadcastReadonlyChange(ctx context.Context, n *Node, enabled bool) error { } for _, member := range members { - endpoint := fmt.Sprintf("http://[%s]:5500/%s", member.Hostname, RestartHaproxyEndpoint) + endpoint := fmt.Sprintf("http://%s:5500/%s", fmt.Sprintf("%s.vm.%s.internal", member.Hostname, n.AppName), RestartHaproxyEndpoint) resp, err := http.Get(endpoint) if err != nil { log.Printf("[WARN] Failed to restart haproxy on member %s: %s", member.Hostname, err)