mirror of
https://github.com/kubernetes-sigs/prometheus-adapter.git
synced 2026-04-07 10:17:51 +00:00
vendor dependencies
This commit is contained in:
parent
604208ef4f
commit
72abf135d6
1156 changed files with 78178 additions and 105799 deletions
2
vendor/k8s.io/client-go/restmapper/category_expansion.go
generated
vendored
2
vendor/k8s.io/client-go/restmapper/category_expansion.go
generated
vendored
|
|
@ -21,7 +21,7 @@ import (
|
|||
"k8s.io/client-go/discovery"
|
||||
)
|
||||
|
||||
// CategoryExpander maps category strings to GroupResouces.
|
||||
// CategoryExpander maps category strings to GroupResources.
|
||||
// Categories are classification or 'tag' of a group of resources.
|
||||
type CategoryExpander interface {
|
||||
Expand(category string) ([]schema.GroupResource, bool)
|
||||
|
|
|
|||
31
vendor/k8s.io/client-go/restmapper/discovery.go
generated
vendored
31
vendor/k8s.io/client-go/restmapper/discovery.go
generated
vendored
|
|
@ -26,7 +26,7 @@ import (
|
|||
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||
"k8s.io/client-go/discovery"
|
||||
|
||||
"github.com/golang/glog"
|
||||
"k8s.io/klog"
|
||||
)
|
||||
|
||||
// APIGroupResources is an API group with a mapping of versions to
|
||||
|
|
@ -145,27 +145,26 @@ func NewDiscoveryRESTMapper(groupResources []*APIGroupResources) meta.RESTMapper
|
|||
// GetAPIGroupResources uses the provided discovery client to gather
|
||||
// discovery information and populate a slice of APIGroupResources.
|
||||
func GetAPIGroupResources(cl discovery.DiscoveryInterface) ([]*APIGroupResources, error) {
|
||||
apiGroups, err := cl.ServerGroups()
|
||||
if err != nil {
|
||||
if apiGroups == nil || len(apiGroups.Groups) == 0 {
|
||||
return nil, err
|
||||
}
|
||||
gs, rs, err := cl.ServerGroupsAndResources()
|
||||
if rs == nil || gs == nil {
|
||||
return nil, err
|
||||
// TODO track the errors and update callers to handle partial errors.
|
||||
}
|
||||
rsm := map[string]*metav1.APIResourceList{}
|
||||
for _, r := range rs {
|
||||
rsm[r.GroupVersion] = r
|
||||
}
|
||||
|
||||
var result []*APIGroupResources
|
||||
for _, group := range apiGroups.Groups {
|
||||
for _, group := range gs {
|
||||
groupResources := &APIGroupResources{
|
||||
Group: group,
|
||||
Group: *group,
|
||||
VersionedResources: make(map[string][]metav1.APIResource),
|
||||
}
|
||||
for _, version := range group.Versions {
|
||||
resources, err := cl.ServerResourcesForGroupVersion(version.GroupVersion)
|
||||
if err != nil {
|
||||
// continue as best we can
|
||||
// TODO track the errors and update callers to handle partial errors.
|
||||
if resources == nil || len(resources.APIResources) == 0 {
|
||||
continue
|
||||
}
|
||||
resources, ok := rsm[version.GroupVersion]
|
||||
if !ok {
|
||||
continue
|
||||
}
|
||||
groupResources.VersionedResources[version.Version] = resources.APIResources
|
||||
}
|
||||
|
|
@ -212,7 +211,7 @@ func (d *DeferredDiscoveryRESTMapper) getDelegate() (meta.RESTMapper, error) {
|
|||
// Reset resets the internally cached Discovery information and will
|
||||
// cause the next mapping request to re-discover.
|
||||
func (d *DeferredDiscoveryRESTMapper) Reset() {
|
||||
glog.V(5).Info("Invalidating discovery information")
|
||||
klog.V(5).Info("Invalidating discovery information")
|
||||
|
||||
d.initMu.Lock()
|
||||
defer d.initMu.Unlock()
|
||||
|
|
|
|||
6
vendor/k8s.io/client-go/restmapper/shortcut.go
generated
vendored
6
vendor/k8s.io/client-go/restmapper/shortcut.go
generated
vendored
|
|
@ -19,7 +19,7 @@ package restmapper
|
|||
import (
|
||||
"strings"
|
||||
|
||||
"github.com/golang/glog"
|
||||
"k8s.io/klog"
|
||||
|
||||
"k8s.io/apimachinery/pkg/api/meta"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
|
|
@ -86,12 +86,12 @@ func (e shortcutExpander) getShortcutMappings() ([]*metav1.APIResourceList, []re
|
|||
// This can return an error *and* the results it was able to find. We don't need to fail on the error.
|
||||
apiResList, err := e.discoveryClient.ServerResources()
|
||||
if err != nil {
|
||||
glog.V(1).Infof("Error loading discovery information: %v", err)
|
||||
klog.V(1).Infof("Error loading discovery information: %v", err)
|
||||
}
|
||||
for _, apiResources := range apiResList {
|
||||
gv, err := schema.ParseGroupVersion(apiResources.GroupVersion)
|
||||
if err != nil {
|
||||
glog.V(1).Infof("Unable to parse groupversion = %s due to = %s", apiResources.GroupVersion, err.Error())
|
||||
klog.V(1).Infof("Unable to parse groupversion = %s due to = %s", apiResources.GroupVersion, err.Error())
|
||||
continue
|
||||
}
|
||||
for _, apiRes := range apiResources.APIResources {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue