From 653ba94e6dcf3e73dbe4382c60d60fc60d9a2c07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Leszko?= Date: Mon, 19 Aug 2024 14:10:07 +0200 Subject: [PATCH] Update hack for resolving catalyst-api url from catalyst --- main.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/main.go b/main.go index 0e58ddc39..9801a21ab 100644 --- a/main.go +++ b/main.go @@ -372,9 +372,9 @@ func resolveCatalystApiURL(cli config.Cli) interface{} { // Hack to reason about the corresponding stateless catalyst-api service // Otherwise we would need to specify CATALYST_API_CATALYST_API_URL env variable, which requires restarting // the whole catalyst node - hostname := os.Getenv("HOSTNAME") // e.g. "staging-catalyst-0" - ecosystem := strings.Split(hostname, "-")[0] // e.g. "staging" - return fmt.Sprintf("http://%s-catalyst-api-%s:7979", ecosystem, hostname) + hostname := os.Getenv("HOSTNAME") // e.g. "staging-catalyst-0" + correspondingCatalystApiHostname := strings.Replace(hostname, "-catalyst-", "-catalyst-api-", 1) // e.g. "staging-catalyst-api-0" + return fmt.Sprintf("http://%s:7979", correspondingCatalystApiHostname) } // not used for other modes return ""