mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-12-15 16:30:55 +01:00
lib/promscrape/discovery/kubernetes: reuse a client for empty api_server
inside different jobs
This commit is contained in:
parent
d5b38eeac4
commit
81481abaa9
@ -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 New Issue
Block a user