mirror of
https://github.com/prometheus/alertmanager
synced 2025-02-27 16:20:24 +00:00
cmd/amtool: use base path from the configured URL (#1940)
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
This commit is contained in:
parent
5ff6cffa08
commit
add7700a8b
@ -16,6 +16,7 @@ package cli
|
|||||||
import (
|
import (
|
||||||
"net/url"
|
"net/url"
|
||||||
"os"
|
"os"
|
||||||
|
"path"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/go-openapi/strfmt"
|
"github.com/go-openapi/strfmt"
|
||||||
@ -75,7 +76,7 @@ func NewAlertmanagerClient(amURL *url.URL) *client.Alertmanager {
|
|||||||
schemes = []string{amURL.Scheme}
|
schemes = []string{amURL.Scheme}
|
||||||
}
|
}
|
||||||
|
|
||||||
cr := clientruntime.New(address, defaultAmApiv2path, schemes)
|
cr := clientruntime.New(address, path.Join(amURL.Path, defaultAmApiv2path), schemes)
|
||||||
|
|
||||||
if amURL.User != nil {
|
if amURL.User != nil {
|
||||||
password, _ := amURL.User.Password()
|
password, _ := amURL.User.Password()
|
||||||
|
Loading…
Reference in New Issue
Block a user