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

[ACM-11543] Check if URL already contains remote write path before appending it #1456

Merged
merged 5 commits into from
May 30, 2024
Merged
Changes from 1 commit
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
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,13 @@ func generateHubInfoSecret(client client.Client, obsNamespace string,
}
}

obsApiURL := url.URL{
Host: obsAPIHost,
Path: operatorconfig.ObservatoriumAPIRemoteWritePath,
if !strings.HasSuffix(obsAPIHost, operatorconfig.ObservatoriumAPIRemoteWritePath) {
douglascamata marked this conversation as resolved.
Show resolved Hide resolved
obsAPIHost += operatorconfig.ObservatoriumAPIRemoteWritePath
douglascamata marked this conversation as resolved.
Show resolved Hide resolved
}

obsApiURL, err := url.Parse(obsAPIHost)
if err != nil {
return nil, err
}
if !obsApiURL.IsAbs() {
obsApiURL.Scheme = "https"
Expand Down
Loading