diff --git a/pkg/controlplane/storageversionhashdata/data.go b/pkg/controlplane/storageversionhashdata/data.go index 337cd8905e8..0ffa9145558 100644 --- a/pkg/controlplane/storageversionhashdata/data.go +++ b/pkg/controlplane/storageversionhashdata/data.go @@ -72,9 +72,9 @@ var GVRToStorageVersionHash = map[string]string{ "storage.k8s.io/v1/csidrivers": "hL6j/rwBV5w=", "storage.k8s.io/v1/csinodes": "Pe62DkZtjuo=", "storage.k8s.io/v1/storageclasses": "K+m6uJwbjGY=", - "storage.k8s.io/v1/csistoragecapacities": "4as6MA/kOg0=", + "storage.k8s.io/v1/csistoragecapacities": "xeVl+2Ly1kE=", "storage.k8s.io/v1/volumeattachments": "tJx/ezt6UDU=", - "storage.k8s.io/v1beta1/csistoragecapacities": "4as6MA/kOg0=", + "storage.k8s.io/v1beta1/csistoragecapacities": "xeVl+2Ly1kE=", "apps/v1/controllerrevisions": "85nkx63pcBU=", "apps/v1/daemonsets": "dd7pWHUlMKQ=", "apps/v1/deployments": "8aSe+NMegvE=", diff --git a/pkg/kubeapiserver/default_storage_factory_builder.go b/pkg/kubeapiserver/default_storage_factory_builder.go index a398d316411..8c204a094b1 100644 --- a/pkg/kubeapiserver/default_storage_factory_builder.go +++ b/pkg/kubeapiserver/default_storage_factory_builder.go @@ -33,7 +33,6 @@ import ( "k8s.io/kubernetes/pkg/apis/extensions" "k8s.io/kubernetes/pkg/apis/networking" "k8s.io/kubernetes/pkg/apis/policy" - apisstorage "k8s.io/kubernetes/pkg/apis/storage" ) // SpecialDefaultResourcePrefixes are prefixes compiled into Kubernetes. @@ -61,9 +60,17 @@ func DefaultWatchCacheSizes() map[schema.GroupResource]int { func NewStorageFactoryConfig() *StorageFactoryConfig { resources := []schema.GroupVersionResource{ - // TODO (https://github.com/kubernetes/kubernetes/issues/108451): remove the override in - // 1.25. - apisstorage.Resource("csistoragecapacities").WithVersion("v1beta1"), + // If a resource has to be stored in a version that is not the + // latest, then it can be listed here. Usually this is the case + // when a new version for a resource gets introduced and a + // downgrade to an older apiserver that doesn't know the new + // version still needs to be supported for one release. + // + // Example from Kubernetes 1.24 where csistoragecapacities had just + // graduated to GA: + // + // TODO (https://github.com/kubernetes/kubernetes/issues/108451): remove the override in 1.25. + // apisstorage.Resource("csistoragecapacities").WithVersion("v1beta1"), } return &StorageFactoryConfig{ diff --git a/test/integration/etcd/data.go b/test/integration/etcd/data.go index eeb5e99c025..567c4a544a9 100644 --- a/test/integration/etcd/data.go +++ b/test/integration/etcd/data.go @@ -257,7 +257,7 @@ func GetEtcdStorageDataForNamespace(namespace string) map[schema.GroupVersionRes gvr("storage.k8s.io", "v1alpha1", "csistoragecapacities"): { Stub: `{"metadata": {"name": "csc-12345-1"}, "storageClassName": "sc1"}`, ExpectedEtcdPath: "/registry/csistoragecapacities/" + namespace + "/csc-12345-1", - ExpectedGVK: gvkP("storage.k8s.io", "v1beta1", "CSIStorageCapacity"), + ExpectedGVK: gvkP("storage.k8s.io", "v1", "CSIStorageCapacity"), }, // -- @@ -318,6 +318,7 @@ func GetEtcdStorageDataForNamespace(namespace string) map[schema.GroupVersionRes gvr("storage.k8s.io", "v1beta1", "csistoragecapacities"): { Stub: `{"metadata": {"name": "csc-12345-2"}, "storageClassName": "sc1"}`, ExpectedEtcdPath: "/registry/csistoragecapacities/" + namespace + "/csc-12345-2", + ExpectedGVK: gvkP("storage.k8s.io", "v1", "CSIStorageCapacity"), }, // -- @@ -329,7 +330,6 @@ func GetEtcdStorageDataForNamespace(namespace string) map[schema.GroupVersionRes gvr("storage.k8s.io", "v1", "csistoragecapacities"): { Stub: `{"metadata": {"name": "csc-12345-3"}, "storageClassName": "sc1"}`, ExpectedEtcdPath: "/registry/csistoragecapacities/" + namespace + "/csc-12345-3", - ExpectedGVK: gvkP("storage.k8s.io", "v1beta1", "CSIStorageCapacity"), }, // --