update prometheus dependencies (#5520)
Signed-off-by: junot <junotxiang@kubesphere.io>
This commit is contained in:
26
vendor/github.com/prometheus/common/config/config.go
generated
vendored
26
vendor/github.com/prometheus/common/config/config.go
generated
vendored
@@ -18,6 +18,7 @@ package config
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"net/http"
|
||||
"path/filepath"
|
||||
)
|
||||
|
||||
@@ -34,7 +35,7 @@ func (s Secret) MarshalYAML() (interface{}, error) {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
//UnmarshalYAML implements the yaml.Unmarshaler interface for Secrets.
|
||||
// UnmarshalYAML implements the yaml.Unmarshaler interface for Secrets.
|
||||
func (s *Secret) UnmarshalYAML(unmarshal func(interface{}) error) error {
|
||||
type plain Secret
|
||||
return unmarshal((*plain)(s))
|
||||
@@ -48,6 +49,29 @@ func (s Secret) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(secretToken)
|
||||
}
|
||||
|
||||
type Header map[string][]Secret
|
||||
|
||||
func (h *Header) HTTPHeader() http.Header {
|
||||
if h == nil || *h == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
header := make(http.Header)
|
||||
|
||||
for name, values := range *h {
|
||||
var s []string
|
||||
if values != nil {
|
||||
s = make([]string, 0, len(values))
|
||||
for _, value := range values {
|
||||
s = append(s, string(value))
|
||||
}
|
||||
}
|
||||
header[name] = s
|
||||
}
|
||||
|
||||
return header
|
||||
}
|
||||
|
||||
// DirectorySetter is a config type that contains file paths that may
|
||||
// be relative to the file containing the config.
|
||||
type DirectorySetter interface {
|
||||
|
||||
Reference in New Issue
Block a user