mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-11-21 14:44:00 +00:00
lib/promscrape/discovery/kubernetes: reuse a client for empty api_server
inside different jobs
This commit is contained in:
parent
d5b38eeac4
commit
81481abaa9
1 changed files with 4 additions and 0 deletions
|
@ -57,6 +57,10 @@ func getAPIResponse(cfg *APIConfig, role, path string) ([]byte, error) {
|
|||
}
|
||||
|
||||
func getHostClient(apiServer string, ac *promauth.Config) (*hcValue, error) {
|
||||
if len(apiServer) == 0 {
|
||||
// ac is ignored when apiServer should be auto-discovered when running inside k8s pod.
|
||||
ac = nil
|
||||
}
|
||||
k := hcKey{
|
||||
apiServer: apiServer,
|
||||
ac: ac,
|
||||
|
|
Loading…
Reference in a new issue