mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-22 03:11:40 +00:00
CSIStorageCapacity: register types unconditionally
That the object was registered depending on the feature gate was called out as unusual during the 1.21 review. Previously, all beta storage APIs were unders such feature gate checks, but its better to drop that to be consistent with the rest of Kubernetes.
This commit is contained in:
parent
a94c141060
commit
e565951063
@ -24,10 +24,8 @@ import (
|
||||
"k8s.io/apiserver/pkg/registry/rest"
|
||||
genericapiserver "k8s.io/apiserver/pkg/server"
|
||||
serverstorage "k8s.io/apiserver/pkg/server/storage"
|
||||
utilfeature "k8s.io/apiserver/pkg/util/feature"
|
||||
"k8s.io/kubernetes/pkg/api/legacyscheme"
|
||||
storageapi "k8s.io/kubernetes/pkg/apis/storage"
|
||||
"k8s.io/kubernetes/pkg/features"
|
||||
csidriverstore "k8s.io/kubernetes/pkg/registry/storage/csidriver/storage"
|
||||
csinodestore "k8s.io/kubernetes/pkg/registry/storage/csinode/storage"
|
||||
csistoragecapacitystore "k8s.io/kubernetes/pkg/registry/storage/csistoragecapacity/storage"
|
||||
@ -77,14 +75,12 @@ func (p RESTStorageProvider) v1alpha1Storage(apiResourceConfigSource serverstora
|
||||
}
|
||||
storage["volumeattachments"] = volumeAttachmentStorage.VolumeAttachment
|
||||
|
||||
// register csistoragecapacity if CSIStorageCapacity feature gate is enabled
|
||||
if utilfeature.DefaultFeatureGate.Enabled(features.CSIStorageCapacity) {
|
||||
csiStorageStorage, err := csistoragecapacitystore.NewStorage(restOptionsGetter)
|
||||
if err != nil {
|
||||
return storage, err
|
||||
}
|
||||
storage["csistoragecapacities"] = csiStorageStorage.CSIStorageCapacity
|
||||
// register csistoragecapacities
|
||||
csiStorageStorage, err := csistoragecapacitystore.NewStorage(restOptionsGetter)
|
||||
if err != nil {
|
||||
return storage, err
|
||||
}
|
||||
storage["csistoragecapacities"] = csiStorageStorage.CSIStorageCapacity
|
||||
|
||||
return storage, nil
|
||||
}
|
||||
@ -119,14 +115,12 @@ func (p RESTStorageProvider) v1beta1Storage(apiResourceConfigSource serverstorag
|
||||
}
|
||||
storage["csidrivers"] = csiDriverStorage.CSIDriver
|
||||
|
||||
// register csistoragecapacity if CSIStorageCapacity feature gate is enabled
|
||||
if utilfeature.DefaultFeatureGate.Enabled(features.CSIStorageCapacity) {
|
||||
csiStorageStorage, err := csistoragecapacitystore.NewStorage(restOptionsGetter)
|
||||
if err != nil {
|
||||
return storage, err
|
||||
}
|
||||
storage["csistoragecapacities"] = csiStorageStorage.CSIStorageCapacity
|
||||
// register csistoragecapacities
|
||||
csiStorageStorage, err := csistoragecapacitystore.NewStorage(restOptionsGetter)
|
||||
if err != nil {
|
||||
return storage, err
|
||||
}
|
||||
storage["csistoragecapacities"] = csiStorageStorage.CSIStorageCapacity
|
||||
|
||||
return storage, nil
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user