mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-29 05:22:37 +00:00
Remove ability to re-enable serving deprecated discoveryv1beta1 APIs
This commit is contained in:
parent
f47d7f3a16
commit
da922f0af6
@ -41,7 +41,6 @@ import (
|
|||||||
coordinationapiv1 "k8s.io/api/coordination/v1"
|
coordinationapiv1 "k8s.io/api/coordination/v1"
|
||||||
apiv1 "k8s.io/api/core/v1"
|
apiv1 "k8s.io/api/core/v1"
|
||||||
discoveryv1 "k8s.io/api/discovery/v1"
|
discoveryv1 "k8s.io/api/discovery/v1"
|
||||||
discoveryv1beta1 "k8s.io/api/discovery/v1beta1"
|
|
||||||
eventsv1 "k8s.io/api/events/v1"
|
eventsv1 "k8s.io/api/events/v1"
|
||||||
flowcontrolv1alpha1 "k8s.io/api/flowcontrol/v1alpha1"
|
flowcontrolv1alpha1 "k8s.io/api/flowcontrol/v1alpha1"
|
||||||
networkingapiv1 "k8s.io/api/networking/v1"
|
networkingapiv1 "k8s.io/api/networking/v1"
|
||||||
@ -712,7 +711,6 @@ var (
|
|||||||
// betaAPIGroupVersionsDisabledByDefault is for all future beta groupVersions.
|
// betaAPIGroupVersionsDisabledByDefault is for all future beta groupVersions.
|
||||||
betaAPIGroupVersionsDisabledByDefault = []schema.GroupVersion{
|
betaAPIGroupVersionsDisabledByDefault = []schema.GroupVersion{
|
||||||
authenticationv1beta1.SchemeGroupVersion,
|
authenticationv1beta1.SchemeGroupVersion,
|
||||||
discoveryv1beta1.SchemeGroupVersion,
|
|
||||||
nodev1beta1.SchemeGroupVersion, // remove in 1.26
|
nodev1beta1.SchemeGroupVersion, // remove in 1.26
|
||||||
policyapiv1beta1.SchemeGroupVersion,
|
policyapiv1beta1.SchemeGroupVersion,
|
||||||
storageapiv1beta1.SchemeGroupVersion,
|
storageapiv1beta1.SchemeGroupVersion,
|
||||||
|
@ -18,7 +18,6 @@ package rest
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
discoveryv1 "k8s.io/api/discovery/v1"
|
discoveryv1 "k8s.io/api/discovery/v1"
|
||||||
discoveryv1beta1 "k8s.io/api/discovery/v1beta1"
|
|
||||||
"k8s.io/apiserver/pkg/registry/generic"
|
"k8s.io/apiserver/pkg/registry/generic"
|
||||||
"k8s.io/apiserver/pkg/registry/rest"
|
"k8s.io/apiserver/pkg/registry/rest"
|
||||||
genericapiserver "k8s.io/apiserver/pkg/server"
|
genericapiserver "k8s.io/apiserver/pkg/server"
|
||||||
@ -37,12 +36,6 @@ func (p StorageProvider) NewRESTStorage(apiResourceConfigSource serverstorage.AP
|
|||||||
// If you add a version here, be sure to add an entry in `k8s.io/kubernetes/cmd/kube-apiserver/app/aggregator.go with specific priorities.
|
// If you add a version here, be sure to add an entry in `k8s.io/kubernetes/cmd/kube-apiserver/app/aggregator.go with specific priorities.
|
||||||
// TODO refactor the plumbing to provide the information in the APIGroupInfo
|
// TODO refactor the plumbing to provide the information in the APIGroupInfo
|
||||||
|
|
||||||
if storageMap, err := p.v1beta1Storage(apiResourceConfigSource, restOptionsGetter); err != nil {
|
|
||||||
return genericapiserver.APIGroupInfo{}, err
|
|
||||||
} else if len(storageMap) > 0 {
|
|
||||||
apiGroupInfo.VersionedResourcesStorageMap[discoveryv1beta1.SchemeGroupVersion.Version] = storageMap
|
|
||||||
}
|
|
||||||
|
|
||||||
if storageMap, err := p.v1Storage(apiResourceConfigSource, restOptionsGetter); err != nil {
|
if storageMap, err := p.v1Storage(apiResourceConfigSource, restOptionsGetter); err != nil {
|
||||||
return genericapiserver.APIGroupInfo{}, err
|
return genericapiserver.APIGroupInfo{}, err
|
||||||
} else if len(storageMap) > 0 {
|
} else if len(storageMap) > 0 {
|
||||||
@ -52,20 +45,6 @@ func (p StorageProvider) NewRESTStorage(apiResourceConfigSource serverstorage.AP
|
|||||||
return apiGroupInfo, nil
|
return apiGroupInfo, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p StorageProvider) v1beta1Storage(apiResourceConfigSource serverstorage.APIResourceConfigSource, restOptionsGetter generic.RESTOptionsGetter) (map[string]rest.Storage, error) {
|
|
||||||
storage := map[string]rest.Storage{}
|
|
||||||
|
|
||||||
if resource := "endpointslices"; apiResourceConfigSource.ResourceEnabled(discoveryv1beta1.SchemeGroupVersion.WithResource(resource)) {
|
|
||||||
endpointSliceStorage, err := endpointslicestorage.NewREST(restOptionsGetter)
|
|
||||||
if err != nil {
|
|
||||||
return storage, err
|
|
||||||
}
|
|
||||||
storage[resource] = endpointSliceStorage
|
|
||||||
}
|
|
||||||
|
|
||||||
return storage, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (p StorageProvider) v1Storage(apiResourceConfigSource serverstorage.APIResourceConfigSource, restOptionsGetter generic.RESTOptionsGetter) (map[string]rest.Storage, error) {
|
func (p StorageProvider) v1Storage(apiResourceConfigSource serverstorage.APIResourceConfigSource, restOptionsGetter generic.RESTOptionsGetter) (map[string]rest.Storage, error) {
|
||||||
storage := map[string]rest.Storage{}
|
storage := map[string]rest.Storage{}
|
||||||
|
|
||||||
|
@ -180,13 +180,6 @@ func GetEtcdStorageDataForNamespace(namespace string) map[schema.GroupVersionRes
|
|||||||
},
|
},
|
||||||
// --
|
// --
|
||||||
|
|
||||||
// k8s.io/kubernetes/pkg/apis/discovery/v1beta1
|
|
||||||
gvr("discovery.k8s.io", "v1beta1", "endpointslices"): {
|
|
||||||
Stub: `{"metadata": {"name": "slicev1beta1"}, "addressType": "IPv4", "protocol": "TCP", "ports": [], "endpoints": []}`,
|
|
||||||
ExpectedEtcdPath: "/registry/endpointslices/" + namespace + "/slicev1beta1",
|
|
||||||
},
|
|
||||||
// --
|
|
||||||
|
|
||||||
// k8s.io/kubernetes/pkg/apis/events/v1
|
// k8s.io/kubernetes/pkg/apis/events/v1
|
||||||
gvr("events.k8s.io", "v1", "events"): {
|
gvr("events.k8s.io", "v1", "events"): {
|
||||||
Stub: `{"metadata": {"name": "event3"}, "regarding": {"namespace": "` + namespace + `"}, "note": "some data here", "eventTime": "2017-08-09T15:04:05.000000Z", "reportingInstance": "node-xyz", "reportingController": "k8s.io/my-controller", "action": "DidNothing", "reason": "Laziness", "type": "Normal"}`,
|
Stub: `{"metadata": {"name": "event3"}, "regarding": {"namespace": "` + namespace + `"}, "note": "some data here", "eventTime": "2017-08-09T15:04:05.000000Z", "reportingInstance": "node-xyz", "reportingController": "k8s.io/my-controller", "action": "DidNothing", "reason": "Laziness", "type": "Normal"}`,
|
||||||
|
Loading…
Reference in New Issue
Block a user