Skip to content

Commit

Permalink
Update hack for resolving catalyst-api url from catalyst (#1361)
Browse files Browse the repository at this point in the history
  • Loading branch information
leszko authored Aug 20, 2024
1 parent 0e69abb commit 7cdedad
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 ""
Expand Down

0 comments on commit 7cdedad

Please sign in to comment.