*: update kube vendor to v1.7.4
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
This commit is contained in:
parent
c67859731f
commit
d56bf090ce
1032 changed files with 273965 additions and 40081 deletions
27
vendor/k8s.io/apimachinery/pkg/api/meta/restmapper.go
generated
vendored
27
vendor/k8s.io/apimachinery/pkg/api/meta/restmapper.go
generated
vendored
|
@ -79,9 +79,6 @@ type DefaultRESTMapper struct {
|
|||
pluralToSingular map[schema.GroupVersionResource]schema.GroupVersionResource
|
||||
|
||||
interfacesFunc VersionInterfacesFunc
|
||||
|
||||
// aliasToResource is used for mapping aliases to resources
|
||||
aliasToResource map[string][]string
|
||||
}
|
||||
|
||||
func (m *DefaultRESTMapper) String() string {
|
||||
|
@ -105,7 +102,6 @@ func NewDefaultRESTMapper(defaultGroupVersions []schema.GroupVersion, f VersionI
|
|||
kindToScope := make(map[schema.GroupVersionKind]RESTScope)
|
||||
singularToPlural := make(map[schema.GroupVersionResource]schema.GroupVersionResource)
|
||||
pluralToSingular := make(map[schema.GroupVersionResource]schema.GroupVersionResource)
|
||||
aliasToResource := make(map[string][]string)
|
||||
// TODO: verify name mappings work correctly when versions differ
|
||||
|
||||
return &DefaultRESTMapper{
|
||||
|
@ -115,13 +111,12 @@ func NewDefaultRESTMapper(defaultGroupVersions []schema.GroupVersion, f VersionI
|
|||
defaultGroupVersions: defaultGroupVersions,
|
||||
singularToPlural: singularToPlural,
|
||||
pluralToSingular: pluralToSingular,
|
||||
aliasToResource: aliasToResource,
|
||||
interfacesFunc: f,
|
||||
}
|
||||
}
|
||||
|
||||
func (m *DefaultRESTMapper) Add(kind schema.GroupVersionKind, scope RESTScope) {
|
||||
plural, singular := KindToResource(kind)
|
||||
plural, singular := UnsafeGuessKindToResource(kind)
|
||||
|
||||
m.singularToPlural[singular] = plural
|
||||
m.pluralToSingular[plural] = singular
|
||||
|
@ -141,10 +136,10 @@ var unpluralizedSuffixes = []string{
|
|||
"endpoints",
|
||||
}
|
||||
|
||||
// KindToResource converts Kind to a resource name.
|
||||
// UnsafeGuessKindToResource converts Kind to a resource name.
|
||||
// Broken. This method only "sort of" works when used outside of this package. It assumes that Kinds and Resources match
|
||||
// and they aren't guaranteed to do so.
|
||||
func KindToResource(kind schema.GroupVersionKind) ( /*plural*/ schema.GroupVersionResource /*singular*/, schema.GroupVersionResource) {
|
||||
func UnsafeGuessKindToResource(kind schema.GroupVersionKind) ( /*plural*/ schema.GroupVersionResource /*singular*/, schema.GroupVersionResource) {
|
||||
kindName := kind.Kind
|
||||
if len(kindName) == 0 {
|
||||
return schema.GroupVersionResource{}, schema.GroupVersionResource{}
|
||||
|
@ -548,19 +543,3 @@ func (m *DefaultRESTMapper) RESTMappings(gk schema.GroupKind, versions ...string
|
|||
}
|
||||
return mappings, nil
|
||||
}
|
||||
|
||||
// AddResourceAlias maps aliases to resources
|
||||
func (m *DefaultRESTMapper) AddResourceAlias(alias string, resources ...string) {
|
||||
if len(resources) == 0 {
|
||||
return
|
||||
}
|
||||
m.aliasToResource[alias] = resources
|
||||
}
|
||||
|
||||
// AliasesForResource returns whether a resource has an alias or not
|
||||
func (m *DefaultRESTMapper) AliasesForResource(alias string) ([]string, bool) {
|
||||
if res, ok := m.aliasToResource[alias]; ok {
|
||||
return res, true
|
||||
}
|
||||
return nil, false
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue