update prometheus dependencies (#5520)

Signed-off-by: junot <junotxiang@kubesphere.io>
This commit is contained in:
junot
2023-02-14 09:46:22 +08:00
committed by GitHub
parent a979342f56
commit 2cd5f45d47
769 changed files with 81283 additions and 30511 deletions

View File

@@ -18,12 +18,12 @@ import (
"compress/gzip"
"encoding/json"
"fmt"
"io/ioutil"
"io"
"net/http"
"time"
"github.com/pkg/errors"
"github.com/prometheus/prometheus/pkg/labels"
"github.com/prometheus/prometheus/model/labels"
)
type apiResponse struct {
@@ -175,7 +175,7 @@ func modifyAPIResponse(f func(string, *apiResponse) (interface{}, error)) func(*
return errors.Wrap(err, "can't decode API response")
}
v, err := f(mustLabelValue(resp.Request.Context()), apir)
v, err := f(MustLabelValue(resp.Request.Context()), apir)
if err != nil {
return err
}
@@ -190,7 +190,7 @@ func modifyAPIResponse(f func(string, *apiResponse) (interface{}, error)) func(*
if err = json.NewEncoder(&buf).Encode(apir); err != nil {
return errors.Wrap(err, "can't encode API response")
}
resp.Body = ioutil.NopCloser(&buf)
resp.Body = io.NopCloser(&buf)
resp.Header["Content-Length"] = []string{fmt.Sprint(buf.Len())}
return nil