Merge pull request #63309 from deads2k/server-13-rootscopedkind

Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

 remove rootscopedkinds from groupmeta

builds on https://github.com/kubernetes/kubernetes/pull/63206

Since, a RESTMapping can only be determined based on a connection to a server, the only thing that needs to know the namespaced-ness of a resource is the code doing the registration.  Everything else is derived from that source of truth.  This removes the other dangling references and collapses down onto the existing namespaced-ness methods in the strategies backing the stores.

@kubernetes/sig-api-machinery-pr-reviews 

```release-note
NONE
```
This commit is contained in:
Kubernetes Submit Queue
2018-05-01 13:10:49 -07:00
committed by GitHub
69 changed files with 209 additions and 186 deletions

View File

@@ -43,7 +43,6 @@ go_library(
"//vendor/k8s.io/apimachinery/pkg/runtime:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/runtime/schema:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/runtime/serializer:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/util/sets:go_default_library",
"//vendor/k8s.io/client-go/kubernetes/scheme:go_default_library",
],
)

View File

@@ -47,7 +47,6 @@ import (
"k8s.io/apimachinery/pkg/apimachinery/announced"
"k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/apimachinery/pkg/util/sets"
"k8s.io/client-go/kubernetes/scheme"
)
@@ -65,12 +64,6 @@ func init() {
&announced.GroupMetaFactoryArgs{
GroupName: corev1.GroupName,
VersionPreferenceOrder: []string{corev1.SchemeGroupVersion.Version},
RootScopedKinds: sets.NewString(
"Node",
"Namespace",
"PersistentVolume",
"ComponentStatus",
),
},
announced.VersionToSchemeFunc{
corev1.SchemeGroupVersion.Version: corev1.AddToScheme,
@@ -84,7 +77,6 @@ func init() {
&announced.GroupMetaFactoryArgs{
GroupName: admissionv1alpha1.GroupName,
VersionPreferenceOrder: []string{admissionv1alpha1.SchemeGroupVersion.Version},
RootScopedKinds: sets.NewString("AdmissionReview"),
},
announced.VersionToSchemeFunc{
admissionv1alpha1.SchemeGroupVersion.Version: admissionv1alpha1.AddToScheme,
@@ -97,7 +89,6 @@ func init() {
if err := announced.NewGroupMetaFactory(
&announced.GroupMetaFactoryArgs{
GroupName: admissionregistrationv1alpha1.GroupName,
RootScopedKinds: sets.NewString("InitializerConfiguration", "ValidatingWebhookConfiguration", "MutatingWebhookConfiguration"),
VersionPreferenceOrder: []string{admissionregistrationv1alpha1.SchemeGroupVersion.Version},
},
announced.VersionToSchemeFunc{
@@ -127,7 +118,6 @@ func init() {
&announced.GroupMetaFactoryArgs{
GroupName: authenticationv1beta1.GroupName,
VersionPreferenceOrder: []string{authenticationv1.SchemeGroupVersion.Version, authenticationv1beta1.SchemeGroupVersion.Version},
RootScopedKinds: sets.NewString("TokenReview"),
},
announced.VersionToSchemeFunc{
authenticationv1beta1.SchemeGroupVersion.Version: authenticationv1beta1.AddToScheme,
@@ -142,7 +132,6 @@ func init() {
&announced.GroupMetaFactoryArgs{
GroupName: authorizationv1.GroupName,
VersionPreferenceOrder: []string{authorizationv1.SchemeGroupVersion.Version, authorizationv1beta1.SchemeGroupVersion.Version},
RootScopedKinds: sets.NewString("SubjectAccessReview", "SelfSubjectAccessReview", "SelfSubjectRulesReview"),
},
announced.VersionToSchemeFunc{
authorizationv1beta1.SchemeGroupVersion.Version: authorizationv1beta1.AddToScheme,
@@ -186,7 +175,6 @@ func init() {
&announced.GroupMetaFactoryArgs{
GroupName: certificatesv1beta1.GroupName,
VersionPreferenceOrder: []string{certificatesv1beta1.SchemeGroupVersion.Version},
RootScopedKinds: sets.NewString("CertificateSigningRequest"),
},
announced.VersionToSchemeFunc{
certificatesv1beta1.SchemeGroupVersion.Version: certificatesv1beta1.AddToScheme,
@@ -200,7 +188,6 @@ func init() {
&announced.GroupMetaFactoryArgs{
GroupName: extensionsv1beta1.GroupName,
VersionPreferenceOrder: []string{extensionsv1beta1.SchemeGroupVersion.Version},
RootScopedKinds: sets.NewString("PodSecurityPolicy"),
},
announced.VersionToSchemeFunc{
extensionsv1beta1.SchemeGroupVersion.Version: extensionsv1beta1.AddToScheme,
@@ -214,7 +201,6 @@ func init() {
&announced.GroupMetaFactoryArgs{
GroupName: imagepolicyv1alpha1.GroupName,
VersionPreferenceOrder: []string{imagepolicyv1alpha1.SchemeGroupVersion.Version},
RootScopedKinds: sets.NewString("ImageReview"),
},
announced.VersionToSchemeFunc{
imagepolicyv1alpha1.SchemeGroupVersion.Version: imagepolicyv1alpha1.AddToScheme,
@@ -254,7 +240,6 @@ func init() {
&announced.GroupMetaFactoryArgs{
GroupName: rbacv1.GroupName,
VersionPreferenceOrder: []string{rbacv1.SchemeGroupVersion.Version, rbacv1beta1.SchemeGroupVersion.Version, rbacv1alpha1.SchemeGroupVersion.Version},
RootScopedKinds: sets.NewString("ClusterRole", "ClusterRoleBinding"),
},
announced.VersionToSchemeFunc{
rbacv1.SchemeGroupVersion.Version: rbacv1.AddToScheme,
@@ -270,7 +255,6 @@ func init() {
&announced.GroupMetaFactoryArgs{
GroupName: schedulingv1alpha1.GroupName,
VersionPreferenceOrder: []string{schedulingv1alpha1.SchemeGroupVersion.Version},
RootScopedKinds: sets.NewString("PriorityClass"),
},
announced.VersionToSchemeFunc{
schedulingv1alpha1.SchemeGroupVersion.Version: schedulingv1alpha1.AddToScheme,
@@ -297,7 +281,6 @@ func init() {
&announced.GroupMetaFactoryArgs{
GroupName: storagev1.GroupName,
VersionPreferenceOrder: []string{storagev1.SchemeGroupVersion.Version, storagev1beta1.SchemeGroupVersion.Version},
RootScopedKinds: sets.NewString("StorageClass"),
},
announced.VersionToSchemeFunc{
storagev1.SchemeGroupVersion.Version: storagev1.AddToScheme,