Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update hack for resolving catalyst-api url from catalyst #1361

Merged
merged 2 commits into from
Aug 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading