cmd/amtool: use base path from the configured URL (#1940)

Signed-off-by: Simon Pasquier <spasquie@redhat.com>
This commit is contained in:
Simon Pasquier 2019-06-25 14:22:29 +02:00 committed by GitHub
parent 5ff6cffa08
commit add7700a8b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -16,6 +16,7 @@ package cli
import (
"net/url"
"os"
"path"
"time"
"github.com/go-openapi/strfmt"
@ -75,7 +76,7 @@ func NewAlertmanagerClient(amURL *url.URL) *client.Alertmanager {
schemes = []string{amURL.Scheme}
}
cr := clientruntime.New(address, defaultAmApiv2path, schemes)
cr := clientruntime.New(address, path.Join(amURL.Path, defaultAmApiv2path), schemes)
if amURL.User != nil {
password, _ := amURL.User.Password()