mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-25 14:35:43 +00:00
Merge pull request #99362 from deads2k/confirm-beta
Use a versioner to convert an internal type into an external type for beta serving
This commit is contained in:
@@ -603,7 +603,7 @@ func (m *Instance) InstallAPIs(apiResourceConfigSource serverstorage.APIResource
|
||||
// Remove resources that serving kinds that are removed.
|
||||
// We do this here so that we don't accidentally serve versions without resources or openapi information that for kinds we don't serve.
|
||||
// This is a spot above the construction of individual storage handlers so that no sig accidentally forgets to check.
|
||||
resourceExpirationEvaluator.RemoveDeletedKinds(groupName, apiGroupInfo.VersionedResourcesStorageMap)
|
||||
resourceExpirationEvaluator.RemoveDeletedKinds(groupName, apiGroupInfo.Scheme, apiGroupInfo.VersionedResourcesStorageMap)
|
||||
if len(apiGroupInfo.VersionedResourcesStorageMap) == 0 {
|
||||
klog.V(1).Infof("Removing API group %v because it is time to stop serving it because it has no versions per APILifecycle.", groupName)
|
||||
continue
|
||||
|
||||
@@ -53,17 +53,22 @@ const PostStartHookName = "priority-and-fairness-config-producer"
|
||||
func (p RESTStorageProvider) NewRESTStorage(apiResourceConfigSource serverstorage.APIResourceConfigSource, restOptionsGetter generic.RESTOptionsGetter) (genericapiserver.APIGroupInfo, bool, error) {
|
||||
apiGroupInfo := genericapiserver.NewDefaultAPIGroupInfo(flowcontrol.GroupName, legacyscheme.Scheme, legacyscheme.ParameterCodec, legacyscheme.Codecs)
|
||||
|
||||
// Flow control storage is shared across different versions.
|
||||
flowControlStorage, err := p.storage(apiResourceConfigSource, restOptionsGetter)
|
||||
if err != nil {
|
||||
return genericapiserver.APIGroupInfo{}, false, err
|
||||
}
|
||||
if apiResourceConfigSource.VersionEnabled(flowcontrolapisv1alpha1.SchemeGroupVersion) {
|
||||
flowControlStorage, err := p.storage(apiResourceConfigSource, restOptionsGetter)
|
||||
if err != nil {
|
||||
return genericapiserver.APIGroupInfo{}, false, err
|
||||
}
|
||||
apiGroupInfo.VersionedResourcesStorageMap[flowcontrolapisv1alpha1.SchemeGroupVersion.Version] = flowControlStorage
|
||||
}
|
||||
|
||||
if apiResourceConfigSource.VersionEnabled(flowcontrolapisv1beta1.SchemeGroupVersion) {
|
||||
flowControlStorage, err := p.storage(apiResourceConfigSource, restOptionsGetter)
|
||||
if err != nil {
|
||||
return genericapiserver.APIGroupInfo{}, false, err
|
||||
}
|
||||
apiGroupInfo.VersionedResourcesStorageMap[flowcontrolapisv1beta1.SchemeGroupVersion.Version] = flowControlStorage
|
||||
}
|
||||
|
||||
return apiGroupInfo, true, nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user