mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-11-21 14:44:00 +00:00
fix access to nil *url.URL (#1180)
* fix access to nil *url.URL Signed-off-by: Megrez Lu <lujiajing1126@gmail.com> * Update lib/promscrape/discovery/kubernetes/api_watcher.go Co-authored-by: Aliaksandr Valialkin <valyala@gmail.com>
This commit is contained in:
parent
7eca60694e
commit
4ee6def68b
1 changed files with 6 additions and 2 deletions
|
@ -190,8 +190,12 @@ func newGroupWatcher(apiServer string, ac *promauth.Config, namespaces []string,
|
|||
}
|
||||
|
||||
func getGroupWatcher(apiServer string, ac *promauth.Config, namespaces []string, selectors []Selector, proxyURL *url.URL) *groupWatcher {
|
||||
key := fmt.Sprintf("apiServer=%s, namespaces=%s, selectors=%s, proxyURL=%v, authConfig=%s",
|
||||
apiServer, namespaces, selectorsKey(selectors), proxyURL, ac.String())
|
||||
proxyURLStr := "<nil>"
|
||||
if proxyURL != nil {
|
||||
proxyURLStr = proxyURL.String()
|
||||
}
|
||||
key := fmt.Sprintf("apiServer=%s, namespaces=%s, selectors=%s, proxyURL=%s, authConfig=%s",
|
||||
apiServer, namespaces, selectorsKey(selectors), proxyURLStr, ac.String())
|
||||
groupWatchersLock.Lock()
|
||||
gw := groupWatchers[key]
|
||||
if gw == nil {
|
||||
|
|
Loading…
Reference in a new issue