mirror of
https://github.com/kubernetes-sigs/prometheus-adapter.git
synced 2026-04-06 01:38:10 +00:00
use ContentTypeProtobuf
Signed-off-by: yangchao <yccharles@163.com>
This commit is contained in:
parent
9a1ffb7b17
commit
6f27e9820a
1 changed files with 4 additions and 0 deletions
|
|
@ -20,6 +20,7 @@ import (
|
||||||
"crypto/tls"
|
"crypto/tls"
|
||||||
"crypto/x509"
|
"crypto/x509"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"k8s.io/apimachinery/pkg/runtime"
|
||||||
"net/http"
|
"net/http"
|
||||||
"net/url"
|
"net/url"
|
||||||
"os"
|
"os"
|
||||||
|
|
@ -251,6 +252,9 @@ func (cmd *PrometheusAdapter) addResourceMetricsAPI(promClient prom.Client, stop
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
rest.AcceptContentTypes = strings.Join([]string{runtime.ContentTypeProtobuf, runtime.ContentTypeJSON}, ",")
|
||||||
|
rest.ContentType = runtime.ContentTypeProtobuf
|
||||||
|
|
||||||
client, err := metadata.NewForConfig(rest)
|
client, err := metadata.NewForConfig(rest)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue