-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Set User object in alertmanager url. #1279
Set User object in alertmanager url. #1279
Conversation
thanks for the contribution! looking at this code, it seems to me that we just want to copy the amURL we're getting from the config, and then update the path. Can you check to see if this code works for you? diff --git a/cli/utils.go b/cli/utils.go
index 256c677..0828373 100644
--- a/cli/utils.go
+++ b/cli/utils.go
@@ -27,11 +27,9 @@ func (s ByAlphabetical) Less(i, j int) bool {
}
func GetAlertmanagerURL(p string) url.URL {
- return url.URL{
- Scheme: (*alertmanagerUrl).Scheme,
- Host: (*alertmanagerUrl).Host,
- Path: path.Join((*alertmanagerUrl).Path, p),
- }
+ amURL := **alertmanagerUrl
+ amURL.Path = path.Join((*alertmanagerUrl).Path, p)
+ return amURL
}
// Parse a list of labels (cli arguments) |
@stuartnelson3 I'm not familiar with the |
|
@stuartnelson3 that code works for me, and makes sense to copy the whole thing instead of selected properties. I updated the PR. |
cool. the code worked for me in my tests, can you double check that it works for you with your basic auth setup? |
Yes, it works for me with basic auth |
* Add --collector.netdev.device-whitelist flag Sometimes it is desired to monitor only one netdev. The golang regexp does not support a negated regex, so the ignored-devices flag is too cumbersome for this task. This change introduces a new flag: accept-devices, which is mutually exclusive to ignored-devices. This flag allows specifying ONLY the netdev you'd like. Signed-off-by: Noam Meltzer <[email protected]>
Sets User object in alertmanager url to enable amtool to work with basic auth for use with proxies. Fixes #1028.