mirror of
https://github.com/fluxcd/flagger.git
synced 2026-04-15 06:57:34 +00:00
Add ability to set Prometheus url with custom path without trailing '/'
This commit is contained in:
@@ -9,6 +9,7 @@ import (
|
||||
"io/ioutil"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"path"
|
||||
"strconv"
|
||||
"strings"
|
||||
"text/template"
|
||||
@@ -84,6 +85,7 @@ func (p *PrometheusClient) RunQuery(query string) (float64, error) {
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
u.Path = path.Join(p.url.Path, u.Path)
|
||||
|
||||
u = p.url.ResolveReference(u)
|
||||
|
||||
@@ -150,6 +152,7 @@ func (p *PrometheusClient) IsOnline() (bool, error) {
|
||||
if err != nil {
|
||||
return false, err
|
||||
}
|
||||
u.Path = path.Join(p.url.Path, u.Path)
|
||||
|
||||
u = p.url.ResolveReference(u)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user