mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-02 09:47:06 +00:00
Not all Kinds should be registered to RESTMapper
This commit is contained in:
@@ -26,6 +26,7 @@ import (
|
|||||||
"github.com/GoogleCloudPlatform/kubernetes/pkg/api/v1beta2"
|
"github.com/GoogleCloudPlatform/kubernetes/pkg/api/v1beta2"
|
||||||
"github.com/GoogleCloudPlatform/kubernetes/pkg/api/v1beta3"
|
"github.com/GoogleCloudPlatform/kubernetes/pkg/api/v1beta3"
|
||||||
"github.com/GoogleCloudPlatform/kubernetes/pkg/runtime"
|
"github.com/GoogleCloudPlatform/kubernetes/pkg/runtime"
|
||||||
|
"github.com/GoogleCloudPlatform/kubernetes/pkg/util"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Version is the string that represents the current external default version.
|
// Version is the string that represents the current external default version.
|
||||||
@@ -122,9 +123,15 @@ func init() {
|
|||||||
"Namespace": true,
|
"Namespace": true,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// these kinds should be excluded from the list of resources
|
||||||
|
ignoredKinds := util.NewStringSet("ListOptions", "DeleteOptions", "Status", "ContainerManifest")
|
||||||
|
|
||||||
// enumerate all supported versions, get the kinds, and register with the mapper how to address our resources
|
// enumerate all supported versions, get the kinds, and register with the mapper how to address our resources
|
||||||
for _, version := range versions {
|
for _, version := range versions {
|
||||||
for kind := range api.Scheme.KnownTypes(version) {
|
for kind := range api.Scheme.KnownTypes(version) {
|
||||||
|
if ignoredKinds.Has(kind) {
|
||||||
|
continue
|
||||||
|
}
|
||||||
mixedCase, found := versionMixedCase[version]
|
mixedCase, found := versionMixedCase[version]
|
||||||
if !found {
|
if !found {
|
||||||
mixedCase = false
|
mixedCase = false
|
||||||
|
Reference in New Issue
Block a user